What's new
docker pull ghcr.io/new-usemame/calibre-web-nextgen:v4.0.147
(or :latest)
Kobo Sync stuck on bulk-imported libraries
If you had a chunk of books that all share one last_modified timestamp — usually from a Calibre SQL import or a database restore — the Kobo sync used to get stuck. The device's "My Books" counter would climb past the real library size, the server kept re-sending the same first 50 books, and a force-resync didn't clear it. The workaround was to delete and recreate the Kobo Sync shelf.
The sync now walks through tied timestamps a batch at a time and finishes. Existing devices don't need a re-sync — the wire token format is backward-compatible.
Thanks @andree392 for the detailed debug log capture, @shavitmichael for the upstream PR pointer, and @Glennza1962 for confirming the shelf-recreate workaround that helped narrow the root cause.
Magic Shelves with Kobo Sync deliver books to the device
Magic Shelves marked for Kobo sync used to populate the cache correctly but the books never reached the Kobo. The membership check ran after a timestamp filter that excluded magic-shelf-only books. Regular Kobo Sync shelves worked because the act of adding a book to a regular shelf stamps a fresh timestamp; magic shelves don't, so their books were filtered out before the membership check.
Magic-shelf books now ride the cache's "rebuilt at" timestamp through the cursor and deliver on the next sync after the cache (re)builds. If a magic shelf has more than 100 books in it at first delivery, the rest of those books will deliver on a follow-up cache rebuild (e.g. when you view the shelf again).
Thanks @recruiterguy for the SQL-evidence-grounded report and the workaround script in discussion #358.
Where this came from
Fork issues #347 and #359. Builds on the multi-device sync work from #213 (@raphi011's CWA #1351 backport) — the termination guarantee that PR established is preserved structurally by the new cursor design.