fix(reader): discard unmatched lifecycle entries

Treat an unmatched lifecycle response as terminal so built-in help documents do not retry until parked. Record the skipped title in sync activity and clear the stale parked warning.

Closes #1886
This commit is contained in:
neon
2026-10-21 19:17:38 +00:00
parent 9ba01498cf
commit d31bf392f4
3 changed files with 148 additions and 2 deletions
@@ -20,6 +20,7 @@ local SUCCESS_TEXT = {
progress_push = function() return _("Sent reading progress") end,
progress_pull = function() return _("Pulled reading progress") end,
connection_test = function() return _("Connection test passed") end,
lifecycle_unmatched = function() return _("Skipped a book not in BookOrbit") end,
}
local ERROR_TEXT = {
+13 -2
View File
@@ -474,9 +474,20 @@ function BookOrbit:requestLifecycleOutboxDrain(source, interactive)
if finished then return end
finished = true
local latest = outbox:readLatest(started.id)
local complete = outbox:isComplete(latest)
local unmatched = err == "unmatched"
local complete = unmatched or outbox:isComplete(latest)
if complete then
outbox:removeEntry(started.id)
if unmatched then
local last_error = self.settings.last_error
if last_error and last_error.event == "lifecycle_outbox"
and last_error.code == "outbox_blocked" then
self.settings.last_error = nil
end
BookOrbitActivity.recordSuccess(
self.settings, "lifecycle_unmatched", snap.title)
G_reader_settings:flush()
end
else
outbox:markFinished(started.id)
self:scheduleLifecycleOutboxRetry()
@@ -494,7 +505,7 @@ function BookOrbit:requestLifecycleOutboxDrain(source, interactive)
end
end
done()
if complete and not err then
if complete and (not err or unmatched) then
self:requestLifecycleOutboxDrain("recovery")
end
end