docs(kobo): record entitlement semantics from upstream packet captures #32
Loading…
Reference in a new issue
No description provided.
Delete branch "kobo-api-entitlement-semantics"
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?
Research pass over the published Kobo reverse-engineering, folded into
docs/kobo-api.md. Doc-only; no behaviour change.Why
v0.1.9 left one question open: the server now offers a changed book, but the device didn't re-download it. That question has a published answer.
The finding
From packet captures in calibre-web#3133:
ChangedEntitlementinvalidates the device's local copy and stops there. The only observed automatic re-download trigger is a changedBookEntitlement.Accessibilityinside aNewEntitlement— and even that covers only the first 5 new books of a sync request.Offering a change and fetching it are separate mechanisms. v0.1.9 fixed the first. The second has no clean protocol affordance.
Also recorded
Three things we already do correctly, now with the reasoning attached so they don't get "improved" later:
RevisionIdstays equal toEntitlementId. Nickel keys entitlements onEntitlementIdand ignoresRevisionId, so a versioned<uuid>-v<n>files a second copy rather than replacing the book. Upstream shipped versioned revisions and reverted them after an on-device retest (xdoubleu#1756 → #1847).ChangedEntitlementcarries noReadingState. That block seeds device state and can overwrite live progress.New.ChangedEntitlementfor a book the device doesn't hold is dropped without trace (calibre-web#3649).Two new hazards:
file_hash, and Nickel marks a re-offered book as not downloaded. Upstream treats this class as release-blocking (Calibre-Web-NextGen#2207).social_hoststill points atsocial.kobobooks.com, which no longer resolves. On firmware 4.38–4.45 the resultingWebRequestErrcan mark an otherwise-clean sync as failed (bookorbit#1550). Not observed on our 4.45 Libra Colour, so it's filed as a hypothesis with a fix sketch, not a change.Deliberately not implemented
The two-phase
Preview→Fullsequence (calibre-web#3394, open and unmerged) does force a re-download:ChangedEntitlementwithAccessibility: "Preview", clear the delivered flag,X-Kobo-sync: continue, thenNewEntitlementwithFull. We already have every primitive it needs. It's documented rather than shipped because it rests on undocumented firmware behaviour and an upstream patch nobody has merged.Note on sources
No official Kobo documentation exists; this is a private API. Every claim added here is attributed to the issue or PR it came from, with its verification status stated — several upstream sources explicitly say they were never confirmed on hardware.
🤖 Generated with Claude Code
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.