Correct unknown upload reconciliation and allow longer upload response

This commit is contained in:
Pigway
2026-10-06 22:18:56 +08:00
parent 557e21ca58
commit 78ff5a6b00
3 changed files with 9 additions and 5 deletions
+7 -4
View File
@@ -703,6 +703,11 @@ class DisplayService:
device = driver.device(refresh=True)
images = driver.images()
expected = (op["result"] or {}).get("image_id")
confirmed = (
bool(expected)
and expected == device.current_content.id
and device.current_content.synced
)
resolved = op["status"] != "UNKNOWN"
if op["status"] == "UNKNOWN" and (
acknowledge
@@ -715,7 +720,7 @@ class DisplayService:
# Acknowledge releases the block; it never resends a write.
self.update(
id,
"COMPLETED" if expected == device.current_content.id else "FAILED",
"COMPLETED" if confirmed else "FAILED",
{"image_id": device.current_content.id},
)
resolved = True
@@ -727,9 +732,7 @@ class DisplayService:
device_id=op["device_id"],
action="reconcile",
),
"CONFIRMED"
if expected == device.current_content.id
else "ACKNOWLEDGED",
"CONFIRMED" if confirmed else "ACKNOWLEDGED",
)
return dict(
operation_id=id,