Fix pending watcher leases for same-second Forgejo dispatches #37

Merged
eraviart merged 1 commit from fix/forgejo-pending-second-precision into master 2026-10-05 21:36:42 +02:00
Owner

Problem

Forgejo reports creation timestamps at second precision; the watcher records dispatchedAt with milliseconds before the POST. The exact Scrutins dispatch of 2026-10-05 (update run 1852) was created at 03:00:44Z while dispatchedAt was 03:00:44.403Z. Its failure was rejected as an older run, retaining a 24-hour pending lease after an upstream 503. Amendements run 1866 exhibits the same issue.

Fix

Normalize the dispatch lower bound to seconds, both for exact UUID matching and the pagination cutoff. Preserve exact dispatch UUID/workflow matching, genuinely older-run rejection and conservative handling of absent/unavailable status. Do not merely continue past the exact matched run.

Validation

Two new regression tests fail before the fix and pass after: same-second failed/cancelled/active/succeeded states (including Paris offset and preceding-second rejection), and same-second pagination. Replaying the real API responses changes recognizedStatus from undefined to failed for both runs. Full suite: 378 passed, 57 skipped; lint: no errors (existing warnings); type-check: passed.

Deployment

Production watch.yml resolves master at startup. Merge, then dispatch a new watcher to let it clear failed pending leases and trigger the normal fenced ingestion workflow. No manual state deletion or corpus write outside CI.

## Problem Forgejo reports creation timestamps at second precision; the watcher records dispatchedAt with milliseconds before the POST. The exact Scrutins dispatch of 2026-10-05 (update run 1852) was created at 03:00:44Z while dispatchedAt was 03:00:44.403Z. Its failure was rejected as an older run, retaining a 24-hour pending lease after an upstream 503. Amendements run 1866 exhibits the same issue. ## Fix Normalize the dispatch lower bound to seconds, both for exact UUID matching and the pagination cutoff. Preserve exact dispatch UUID/workflow matching, genuinely older-run rejection and conservative handling of absent/unavailable status. Do not merely continue past the exact matched run. ## Validation Two new regression tests fail before the fix and pass after: same-second failed/cancelled/active/succeeded states (including Paris offset and preceding-second rejection), and same-second pagination. Replaying the real API responses changes recognizedStatus from undefined to failed for both runs. Full suite: 378 passed, 57 skipped; lint: no errors (existing warnings); type-check: passed. ## Deployment Production watch.yml resolves master at startup. Merge, then dispatch a new watcher to let it clear failed pending leases and trigger the normal fenced ingestion workflow. No manual state deletion or corpus write outside CI.
eraviart merged commit 111a21906d into master 2026-10-05 21:36:42 +02:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
logiciels/tricoteuses-assemblee!37
No description provided.