fix(kobo): keep metadata file writes off the re-download path

Embedding metadata rewrites the book file, so its hash moves even though the book itself is
unchanged. Kobo reconcile reads a moved hash as new content and re-delivers the book as a
NewEntitlement, which makes the device rebuild its local entry and orphan every annotation
attached to the old one.

Carry the post-write hash into the device snapshots that recorded the pre-write hash, so
reconcile stays on the metadata-only path. The device keeps the bytes it already has and never
receives the rewritten file; a content change from any other source still triggers a download.

Ref #925
This commit is contained in:
neon
2026-08-08 05:59:48 +00:00
parent b09b71dbfe
commit d8105d4820
7 changed files with 272 additions and 19 deletions
+1
View File
@@ -583,6 +583,7 @@ export const E2E_SUITES = Object.freeze({
changedPaths: [
"server/src/modules/kobo/**",
"server/src/modules/book/**",
"server/src/modules/file-write/**",
"server/test/kobo-multi-device-sync.e2e-spec.ts",
"server/test/e2e/reader-state-isolation/**",
"packages/types/src/book.ts",