fix: allow retry after definitive publish failures
Frontend CI / Frontend (push) Successful in 3m18s
Backend CI / Backend (push) Successful in 16m16s
Desktop Client Build / Publish Client Artifacts to NAS (push) Successful in 26s
Desktop Client Build / Resolve Build Metadata (push) Successful in 26s
Desktop Client Build / Build Desktop Client (push) Successful in 25m45s

This commit is contained in:
2026-06-25 00:22:59 +08:00
parent 2ec266201c
commit ed48674ab5
13 changed files with 473 additions and 162 deletions
@@ -849,6 +849,10 @@ SET status = CASE
active_attempt_id = NULL,
lease_token_hash = NULL,
lease_expires_at = NULL,
publish_submit_started_at = CASE
WHEN $1::text = 'retry' THEN NULL
ELSE publish_submit_started_at
END,
attempts = CASE WHEN $1::text = 'retry' THEN 0 ELSE attempts END,
updated_at = now()
WHERE desktop_id = $4
@@ -39,6 +39,10 @@ func TestReconcileDesktopTaskRetryResetsAttempts(t *testing.T) {
if !strings.Contains(query, "attempts = CASE WHEN $1::text = 'retry' THEN 0 ELSE attempts END") {
t.Fatalf("retry reconcile must reset attempts so manual retry can be leased; query:\n%s", query)
}
if !strings.Contains(query, "publish_submit_started_at = CASE") ||
!strings.Contains(query, "WHEN $1::text = 'retry' THEN NULL") {
t.Fatalf("retry reconcile must clear stale publish submit marker; query:\n%s", query)
}
if strings.Contains(query, "attempts + CASE") {
t.Fatalf("retry reconcile must not increment attempts; query:\n%s", query)
}