fix(auth): lower lockAcquireTimeout default to 5s and fix stale JSDoc#2125
fix(auth): lower lockAcquireTimeout default to 5s and fix stale JSDoc#2125
Conversation
|
No actionable comments were generated in the recent review. 🎉 📝 WalkthroughSummary by CodeRabbit
WalkthroughThe pull request reduces the lock acquisition timeout in the GoTrueClient authentication library from 10,000 milliseconds to 5,000 milliseconds. This change is applied to the default options configuration, with corresponding updates to type documentation explaining lock recovery semantics and the behavior of different timeout values. Test cases have been updated to reflect the new default timeout value. Comment |
@supabase/auth-js
@supabase/functions-js
@supabase/postgrest-js
@supabase/realtime-js
@supabase/storage-js
@supabase/supabase-js
commit: |
fadymak
left a comment
There was a problem hiding this comment.
LGTM, just one note that this could potentially be a behavioral breaking change:
a positive timeout now triggers steal-based recovery instead
|
@fadymak timeout was there since before. we just decreased it to 5s, as you suggested! |
The SDK now handles orphaned lock recovery via steal internally (supabase-js#2106). Keep the BroadcastChannel observability wrapper for Sentry signals. The steal-based orphaned lock recovery in `debuggableNavigatorLock` (packages/common/gotrue.ts) (introduced in #39868) is now redundant, supabase-js#2106 handles this natively in the SDK. Removes the `navigator.locks.request({ steal: true })` block while keeping the BroadcastChannel wrapper that sends lock-holder stack traces to Sentry. Related: supabase/supabase-js#2106, supabase/supabase-js#2125
Description
Follow-up to #2106 (steal-based orphaned-lock recovery).
lockAcquireTimeoutdefault from 10 s to 5 s (GoTrueClient.ts). The auth team aligned on a shorter default in the original Slack thread; now that the steal fallback handles recovery, a shorter wait is safe.lockJSDoc (types.ts): the previous comment claimed "no locking is done by default", which is false —navigatorLock(Web Locks API) has been the default in browser environments withpersistSession: trueforsome time.
lockAcquireTimeoutJSDoc (types.ts): the previous doc said a positive timeout throwsLockAcquireTimeoutError. With fix(auth): recover from orphaned navigator locks via steal fallback #2106 merged, a positive timeout now triggers steal-based recovery instead. Updated@default, bullet descriptions, and the example snippet accordingly.