Offer content changes to the device, not just shelf changes #31
Loading…
Reference in a new issue
No description provided.
Delete branch "sync-content-changes"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The backfill rewrote three epubs and the Kobo did not re-download. The
file_hash assumption was right; the code path that acts on it was never
reached.
The bug
LibrarySyncreuses a drained session when the shelf "still looks thesame", and that was decided by
setsEqualover book IDs:A changed book keeps its place on the shelf. So the session was reused,
no snapshot was built, and
ComputeDelta— which does compareFileHashandMetaRev— never ran.Observed live: the session created at 10:03 was still current at 10:45,
holding
file_hash 95f478e4for a book whose row said32f39663. Itwould have stayed that way indefinitely.
Scope is wider than covers. Any edit — retitle, author, description,
series — was invisible to the device unless some book was added or
removed from the shelf.
The fix
A drained session matches the shelf only when it holds the same books
and the same
(file_hash, meta_rev)for each. Membership is notevidence of being up to date.
Testing
Three new sync tests, driving real sync conversations with tokens:
ChangedEntitlementdoes not resync for ever
updated_atis second-granularity, so the metadata test ages the rowrather than sleeping; a metadata-only edit inside the same second as the
snapshot is genuinely indistinguishable. Cover and file rewrites change
file_hash, so they are detected regardless.🤖 Generated with Claude Code