You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(auth): scope the adapter's native transactions to SCIM protocol requests (#3653)
Measured twice on the unscoped variant: better-auth wraps whole request
flows in adapter.transaction (runWithTransaction), so opening a real
driver transaction around every sign-in/sign-up starved the
single-connection sqlite pools — the dogfood showcase boot deadlocked on
'Acquire connection error' until the 180s hook timeout, in CI and
reproduced locally on this branch, with 337 sibling dogfood tests green.
The scim verifier now marks its request's async chain (AsyncLocalStorage
enterWith), and config.transaction opens a real engine.transaction only
inside that scope — exactly where assertNativeSCIMTransactions demands
atomicity. Every other better-auth flow keeps the sequential behaviour
it has always had under the factory's as-is fallback, so nothing existing
weakens. Re-measured after the fix: the deadlocked dogfood file passes in
19s (13/13), the credential-at-rest suite (which drives a real SCIM 2.0
request through the scoped transaction over better-sqlite3) stays green,
and the full plugin-auth suite is 81 files / 1660 tests green.
Co-authored-by: Claude <noreply@anthropic.com>
0 commit comments