Files
freno-dev/src/routes/api/the-nook
Michael Freno 0b128f6639 nook: claim lifecycle sends so concurrent runs cannot double-mail
The lifecycle job marked rows with an unconditional UPDATE before
sending, so two overlapping invocations (cron tick + manual hit, or
retry) both passed the SELECT, both ran the UPDATE — re-writing the
same value — and both sent the same email. Real duplicates went out to
licensees. Rows are now claimed with a conditional UPDATE (... AND
asked_at IS NULL), and the send happens only when the claim reports
rowsAffected 1; a racing invocation claims nothing and sends nothing.

Tests: lifecycle suite gains a lost-claim case; 36 nook API tests pass.

Issue: FRE-11
2026-10-05 09:38:48 -04:00
..
2026-08-26 17:41:57 -04:00
2026-08-26 17:41:57 -04:00
2026-08-26 17:41:57 -04:00
2026-08-26 17:41:57 -04:00
2026-09-01 17:44:20 -04:00
2026-09-01 17:44:20 -04:00
2026-08-26 17:41:57 -04:00