Failed Audit Event Delivery Is Skipped on Retry
Level 2 · node · Reliability · Outbox cursor advances after failed delivery
Scenario
A fictional equipment audit system sends queued events to an external recorder in order. Successfully delivered events advance a cursor so they are not sent again. A temporary delivery failure also advances the cursor, causing that event to be lost on the next run. Trace the repository, delivery service, and controller to locate the incorrect recovery position.
Requirements
Advance the cursor only after successful delivery. On failure, leave that event pending and stop processing later events during the same run. The next invocation must resume at the failed event without replaying completed events. Do not mutate source events or add dependencies.
Acceptance criteria
- Successfully delivered events are acknowledged.
- A failed event remains eligible for the next run.
- Events after a failure are not delivered in that run.
- After recovery, delivery resumes in order at the failed event.
- Previously completed events are not delivered again.
- An empty queue returns zero deliveries and a zero cursor.