readest/apps
Agrova ba98644174
fix(opds): save the tombstone when an auto-downloaded update re-keys a book (#8180)
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>
2026-12-02 14:02:55 +08:00
..
readest-app fix(opds): save the tombstone when an auto-downloaded update re-keys a book (#8180) 2026-12-02 14:02:55 +08:00
readest-calibre-plugin feat(calibre): add multi-language support (#6768) 2026-10-13 18:46:06 +02:00
readest-crosspoint-plugin feat(crosspoint): sign in with a code through /api/auth/device (owner: "use a more generic path for /api/crosspoint/device/code") (#7859) 2026-11-24 04:21:00 +01:00
readest.koplugin chore(deps): bump localsend to v1.19.0 for the fingerprint, PIN and transfer fixes (#8107) 2026-11-30 14:30:12 +01:00