Description
After reading on a Kobo device, it occasionally shows a "Return to last page read?" popup. Accepting it jumps to a previous reading position that is not actually behind where the user left off, no reading progress was lost.
A previous fix #3585 addressed related popup triggers (float/int mismatch and dropped fields in bookmark responses). This issue identifies behavior that persists after that fix.
To Reproduce
- Open a book on a Kobo device synced to Calibre-Web and read to any position
- Set the device down with the book open and let it auto-sleep from inactivity (do not press the sleep button - manual sleep appears to trigger a sync/update first)
- Wait a few minutes
- Wake the device with the book open - the popup may take a few seconds and does not appear on every attempt, but reproduces more reliably with auto-sleep
Hypothesis
- The
/v1/library/<uuid>/state PUT handler saves the new reading position and advances priority_timestamp server-side, but the PUT response does not include the updated timestamp
- The device sends a PUT when saving position (turning pages, manually going to sleep), but sends a GET passively on wake or WiFi reconnect - without necessarily sending a PUT first
- The device's cached
priority_timestamp is only updated from GET responses, not PUT responses - leaving it stale between the two events
- When the device wakes and sends a GET, the server returns a
priority_timestamp the device has never been told about → popup
Proposed Fix
Include PriorityTimestamp in the PUT response UpdateResults so the device can update its cached value immediately, closing the window between PUT and the next GET.
I am testing this locally and will follow up with a PR if it holds up.
Environment
- OS: macOS (server-side issue, not OS-specific)
- Python version: 3.13
- Calibre-Web version:
nightly
- Docker: None
- Kobo firmware: recent testing on 4.44.23552, but observed on earlier firmware before
Description
After reading on a Kobo device, it occasionally shows a "Return to last page read?" popup. Accepting it jumps to a previous reading position that is not actually behind where the user left off, no reading progress was lost.
A previous fix #3585 addressed related popup triggers (float/int mismatch and dropped fields in bookmark responses). This issue identifies behavior that persists after that fix.
To Reproduce
Hypothesis
/v1/library/<uuid>/statePUT handler saves the new reading position and advancespriority_timestampserver-side, but the PUT response does not include the updated timestamppriority_timestampis only updated from GET responses, not PUT responses - leaving it stale between the two eventspriority_timestampthe device has never been told about → popupProposed Fix
Include
PriorityTimestampin the PUT responseUpdateResultsso the device can update its cached value immediately, closing the window between PUT and the next GET.I am testing this locally and will follow up with a PR if it holds up.
Environment
nightly