incrementing-write-unguarded
errorA relative write (increment, x = x + n, $inc, push) runs with no dedupe guard.
Why it goes wrong
Unlike setting a value, applying a delta is not idempotent: every redelivery adds it again, silently corrupting balances and counters.
Safe pattern
Claim the event in the same transaction as the write, or store the event's contribution keyed by event id and derive the total from it.
See it in the playground →
An example handler that triggers this rule.
Safe patterns guide →
Keys, transactions, leases, and status codes.
Configure
// retrysafe.config.ts
export default defineConfig({
rules: { "incrementing-write-unguarded": "error" }, // or "off"
});
// or, for one line (a reason is required):
// retrysafe-ignore incrementing-write-unguarded -- <why this is safe>