retrysafe
← All rules

record-before-effect-no-tx

error

The event is marked processed before its work runs, outside one transaction and with no rollback.

Why it goes wrong

If the process dies after the claim, the event stays marked as processed with its work undone. The retry is skipped as a duplicate and the event is lost.

Safe pattern

Insert the processed-event row in the same transaction as the writes. For external effects, release the claim on failure, use a short lease TTL, or use an outbox.

Configure

// retrysafe.config.ts
export default defineConfig({
  rules: { "record-before-effect-no-tx": "error" }, // or "off"
});

// or, for one line (a reason is required):
// retrysafe-ignore record-before-effect-no-tx -- <why this is safe>