Prevent failed curation tasks from prematurely triggering the de-dupe fan-in step #23

Open
opened 2026-06-29 03:38:52 +00:00 by erik · 0 comments
Owner

runCuratePhoto's finally block calls decrementRunningRuns every time the task runs (handlers.ts:336). If a curate-photo task throws and the worker retries it, the finally decrements the counter again on each retry. Enough retries can drive remaining_count to zero early and fire flag-duplicates before phase 1 is actually done (or fire it more than once). The per-photo data writes are fine on retry; it's the trip-run counter that double-counts. This only affects the trip-wide composite path (/api/trips/:id/curation), not the per-photo or free verbs you're exercising now — but it's a genuine bug worth a ticket.

runCuratePhoto's finally block calls decrementRunningRuns every time the task runs (handlers.ts:336). If a curate-photo task throws and the worker retries it, the finally decrements the counter again on each retry. Enough retries can drive remaining_count to zero early and fire flag-duplicates before phase 1 is actually done (or fire it more than once). The per-photo data writes are fine on retry; it's the trip-run counter that double-counts. This only affects the trip-wide composite path (/api/trips/:id/curation), not the per-photo or free verbs you're exercising now — but it's a genuine bug worth a ticket.
Sign in to join this conversation.
No description provided.