From 75bf511bc17b8bb49bf2ee37634cba70a477fdf5 Mon Sep 17 00:00:00 2001 From: John O'Keefe Date: Tue, 22 Sep 2026 10:41:38 -0400 Subject: [PATCH] fix(sync): apply manual pulls regardless of forward/backward strategy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit _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. --- main.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/main.lua b/main.lua index a04d9fb..0d41289 100644 --- a/main.lua +++ b/main.lua @@ -1520,7 +1520,14 @@ function Bookhoard:_doGetProgress(interactive) sync_text = T(_("Sync to page %1 of %2 from server?"), target_page, total) 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 self:syncToProgress(nav_target, server_percentage) self:_showSyncedMessage()