You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
lastPageRead is stored as a plain page index and is only ever clamped against the current pageCount (see ChapterMutation.kt's updateChapter handling, and updateChapterPersistence/refreshChapterPageList in ChapterForDownload.kt). It's never remapped when the meaning of an index changes.
Once the tall-image splitting feature proposed in #2288 lands, downloading a chapter can insert extra page files earlier in the sequence (a single tall page becomes several files). This shifts the index of every page after the split point.
Repro
Read part of a not-yet-downloaded chapter up to some page N (client sends updateChapter(lastPageRead: N)).
The reader resumes at the same logical page the user left off at.
Actual
lastPageRead is still N, but N in the new, split-aware file indexing no longer refers to the same logical page - it now points to whatever page ended up at that position after the extra split-generated files were inserted earlier in the sequence. The reader silently resumes at the wrong page.
Note
This isn't specific to reading a chapter live before downloading it - the same shift happens for a chapter downloaded from scratch, as long as a split occurs before whatever page index was already recorded as read (e.g. from a prior partial read, or synced from another device/KOReader). Filed while reviewing #2289's fix and cross-checking its interaction with #2288's proposed splitting; not something the #2289 fix addresses since it's purely about download/read concurrency, not about what page indices mean after a split.
Summary
lastPageReadis stored as a plain page index and is only ever clamped against the currentpageCount(seeChapterMutation.kt'supdateChapterhandling, andupdateChapterPersistence/refreshChapterPageListinChapterForDownload.kt). It's never remapped when the meaning of an index changes.Once the tall-image splitting feature proposed in #2288 lands, downloading a chapter can insert extra page files earlier in the sequence (a single tall page becomes several files). This shifts the index of every page after the split point.
Repro
updateChapter(lastPageRead: N)).Expected
The reader resumes at the same logical page the user left off at.
Actual
lastPageReadis stillN, butNin the new, split-aware file indexing no longer refers to the same logical page - it now points to whatever page ended up at that position after the extra split-generated files were inserted earlier in the sequence. The reader silently resumes at the wrong page.Note
This isn't specific to reading a chapter live before downloading it - the same shift happens for a chapter downloaded from scratch, as long as a split occurs before whatever page index was already recorded as read (e.g. from a prior partial read, or synced from another device/KOReader). Filed while reviewing #2289's fix and cross-checking its interaction with #2288's proposed splitting; not something the #2289 fix addresses since it's purely about download/read concurrency, not about what page indices mean after a split.