fix: defer background cleanup until pending display is confirmed
Community checks / verify (push) Skipped
Verify Frame Flow / verify (push) Successful in 7m44s

This commit is contained in:
渡口浪人
2026-10-18 20:32:37 +08:00
parent a2e8a204e8
commit 28e971c0ff
5 changed files with 40 additions and 15 deletions
+11 -9
View File
@@ -518,11 +518,11 @@ class DisplayService:
) and self.blocked(op["device_id"]):
continue
payload = json.loads(op["payload"])
if op["action"] == "display":
if op["client_id"] in (
"scheduler",
"scheduler-retry",
) and self.db.one(
if (
op["action"] in ("display", "delete", "restore")
and op["client_id"]
in ("scheduler", "scheduler-retry", "cloud-library", "retention")
and self.db.one(
"SELECT id FROM operations WHERE device_id=? AND action='display' "
"AND status='SYNCING' AND write_started=1 AND updated_at>? LIMIT 1",
(
@@ -532,10 +532,12 @@ class DisplayService:
- timedelta(seconds=self.settings.sync_timeout)
).isoformat(),
),
):
# Upload activates a new image upstream. Give the prior
# image its existing confirmation window before replacing it.
continue
)
):
# Both upload and deletion update the cloud frame counter.
# Automatic writes must not invalidate a pending display ack.
continue
if op["action"] == "display":
priority = payload["options"]["priority"]
top = self.top(op["device_id"])
if top and priority < top["priority"]: