The claim that the user-row lock plus SQLite IMMEDIATE stops one credit being spent twice was untested. Two threads on separate connections now ask at the same time: one answer, one credit spent; the same Idempotency-Key arriving twice at once also costs one credit. Removing transaction_mode IMMEDIATE turns both red (500, database is locked). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3.1 KiB
3.1 KiB