87e46130

By: Michael Lynch <git@mtlynch.io>

Consume magic login tokens atomically

Move successful token consumption into a conditional UPDATE so SQLite enforces the unused and unexpired token invariant in the write operation. Keep the follow-up lookup only to preserve distinct error messages for rejected tokens.

Suite timing

Time to Start Worker time Duration Time to finish
Config 0s 4s 4s 5s
Eval 4s 3m54s 3m54s 3m59s
Build 54s 23m42s 3m16s 4m10s
Test - - - -
Deploy - - - -
Suite 0s 27m41s 4m10s 4m10s

Timeline

0s20s40s1m1m20s1m40s2m2m20s2m40s3m3m20s3m40s4m