Sync progress both ways, by whichever side changed last #14
Loading…
Reference in a new issue
No description provided.
Delete branch "refs/pull/14/head"
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?
Summary
Reading on the device stopped reaching Kavita — every sync said "Nothing to
sync". Not a regression, a scope limit: phase 2 shipped EPUB push-only and
the library moved to PDFs. Measured on the device:
100% of the library legitimately produced "Nothing to sync", and one line of UI
could not distinguish that from "everything was silently discarded".
What changed
would just relocate it. Pushing needs a page fraction (
npage > 0), pullingneeds a position string this app can rewrite — neither is a property of the
extension. CBZ/CBR will sync with no code change.
position_tsvslastModifiedUtc. Both are real UTC andagree within 30 s, verified — so no local state file is needed.
only the reader knows which state is real, so
decide()returns both and theapp asks with the two states as the two buttons. Forward pushes on the newer
side still apply silently.
DeviceProgressWriter— the only code that writes to the device. AlwaysUPDATE, profile 1 only, position substituted into the existing string(never synthesized), one-time DB backup before the first write.
Verified against real data
scripts/dryrun.sh(new) replays the real decision path over a copy of thedevice DB and the live server, writing nothing:
It exists because unit tests could never have caught the original bug: the fakes
faithfully replayed what we believed.
Known limits
epubcficannot bederived from a page number. Kavita-side "finished" can still be applied, since
that is a boolean rather than a position.
offset fields' units are unknown and a wrong guess lands the reader anywhere;
it reports an honest skip instead. Experiment documented in the plan.
Test plan
that page. Not yet run — the one check that proves the device-write path,
and worth doing before this lands.
🤖 Generated with Claude Code