fix(sync): apply manual pulls regardless of forward/backward strategy

_doGetProgress ran every pull through the same forward/backward strategy
gate as the automatic flows (pull-on-open, periodic). With the default
sync_backward = DISABLE, a manual "Pull progress from server" on a book
where the server sat BEHIND the device hit the backward branch, matched
neither SILENT nor PROMPT, and silently did nothing: no prompt, no
message, no navigation. Reported against the Bookhoard server's KOReader
integration (Sense and Sensibility: device at XXXIX, server web reader
at VIII; the server correctly served the converted xpointer
/body/DocFragment[10]/body/div[1]/h2[1] per its logs — the pull reply
was consumed and then dropped by the gate).

An explicit user pull is 'take me to the server position', so it now
bypasses the strategies entirely: syncToProgress + _showSyncedMessage.
The equal-percentage 'already synchronized' early-out is unchanged.

Automatic pulls keep their existing behavior:
- forward/backward SILENT: apply silently
- forward/backward PROMPT: ConfirmBox with the computed target page
- DISABLE: silent skip (intended for pull-on-open / auto-sync)

Verified with a stubbed-KOReader harness driving _doGetProgress through
seven scenarios (manual behind/ahead/equal/no-locator, automatic
SILENT/PROMPT/DISABLE).

Server behavior untouched.
This commit is contained in:
John O'Keefe
2026-09-22 10:41:38 -04:00
parent d584f17092
commit 75bf511bc1
+8 -1
View File
@@ -1520,7 +1520,14 @@ function Bookhoard:_doGetProgress(interactive)
sync_text = T(_("Sync to page %1 of %2 from server?"), target_page, total) sync_text = T(_("Sync to page %1 of %2 from server?"), target_page, total)
end end
if self_older then -- The forward/backward strategies gate AUTOMATIC sync only. A manual
-- pull is an explicit "take me to the server position", so honoring
-- sync_backward=DISABLE here silently swallowed it (no prompt, no
-- message, no navigation) whenever the server sat behind this device.
if interactive then
self:syncToProgress(nav_target, server_percentage)
self:_showSyncedMessage()
elseif self_older then
if self.settings.sync_forward == SYNC_STRATEGY.SILENT then if self.settings.sync_forward == SYNC_STRATEGY.SILENT then
self:syncToProgress(nav_target, server_percentage) self:syncToProgress(nav_target, server_percentage)
self:_showSyncedMessage() self:_showSyncedMessage()