Commit Graph
1 Commits
Author SHA1 Message Date
Omar SobhandClaude Opus 4.8 6071e1fd61 fix(auth): make JIT provisioning idempotent under concurrent first-login
ci / gates (push) Has been cancelled
ci / rust (push) Has been cancelled
ci / sandbox-k8s (push) Has been cancelled
ci / frontend (push) Has been cancelled
ci / e2e (push) Has been cancelled
On a user's first login the authed shell fires several API calls at once;
each ran the JIT-provision path and raced to INSERT the same new user row,
tripping the partial unique index on auth_subject. The losing requests
500'd and the post-login SSR errored out. Use INSERT ... ON CONFLICT
(auth_subject) DO UPDATE ... RETURNING so concurrent callers converge on
the row the winner created. Regenerated the .sqlx offline query cache.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-06-15 03:25:31 -07:00