mirror of
https://github.com/readest/readest.git
synced 2026-12-02 09:00:04 +00:00
When an OPDS auto-download brings a new build of a book already in the library (same metaHash, new file), importBook re-keys the row and appends a deletedAt tombstone for the retired hash to the array it was given (#6703). useOPDSSubscriptions gave it a snapshot of the library and merged only the returned books into the store, so the tombstone was never saved or pushed. The cloud kept the old hash live, the next pull shelved it again as a second card, and reading that card moved the updated book by fraction. persistImportedBooks now carries tombstones that importBook appended to the snapshot into the saved library. If the store replaced the row meanwhile (a progress save or a sync during the download), the tombstone takes the place of that copy, so only the re-keyed row stays live. Verified: - useOPDSSubscriptions.test.tsx: the two new tests fail with main's hook ("expected undefined to be truthy", "expected null to be truthy") and pass with this change. - Related suites (49 files, 693 tests), pnpm lint and pnpm format:check on the change merged onto main; CI green. - dev-web, local OPDS feed with Auto-download on, fake signed-in session: after build 2, main kept the old hash live (pushed live, 2 cards after a restart); with this change it was saved and pushed with deletedAt and one card remained. - Not run on Android or with a second synced device. Fixes #8179 Reported by Agrova on GitHub. Co-Authored-By: Claude Code (Claude Opus 5.5) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| readest-app | ||
| readest-calibre-plugin | ||
| readest-crosspoint-plugin | ||
| readest.koplugin | ||