Skip to content

fix(auth): preserve default lock acquire timeout - #2493

Closed
pjpjq wants to merge 1 commit into
supabase:masterfrom
pjpjq:codex/preserve-lock-acquire-timeout
Closed

fix(auth): preserve default lock acquire timeout#2493
pjpjq wants to merge 1 commit into
supabase:masterfrom
pjpjq:codex/preserve-lock-acquire-timeout

Conversation

@pjpjq

@pjpjq pjpjq commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes #2492.

SupabaseClient was always forwarding lockAcquireTimeout to SupabaseAuthClient, even when the caller did not configure it. Because the forwarded property was explicitly undefined, auth-js' default merge treated it as an override and replaced the documented 5000 ms default with undefined.

This PR only includes lockAcquireTimeout in the auth client options when it is actually defined, so default-config clients keep auth-js' fallback while explicit values still pass through.

Testing

  • pnpm install --frozen-lockfile
  • pnpm nx test:unit supabase-js --testPathPatterns=SupabaseAuthClient.test.ts
  • pnpm prettier --check packages/core/supabase-js/src/SupabaseClient.ts packages/core/supabase-js/test/unit/SupabaseAuthClient.test.ts
  • pnpm exec eslint packages/core/supabase-js/src/SupabaseClient.ts packages/core/supabase-js/test/unit/SupabaseAuthClient.test.ts (0 errors; existing warnings only)
  • git diff --check

Notes:

  • pnpm nx typecheck supabase-js was blocked before running by an existing workspace sync warning from Nx.
  • pnpm nx lint supabase-js was blocked by a missing optional Expo integration lint dependency (eslint-config-expo/flat), so I ran ESLint on the changed files directly instead.

@pjpjq
pjpjq requested a review from a team as a code owner July 6, 2026 04:37
@mandarini

Copy link
Copy Markdown
Contributor

Thanks @pjpjq, the fix here is correct, but #2392 (shipped in 2.107.0) removed navigator.locks as the default coordination mechanism, so the infinite-wait this was guarding against no longer applies to default-config clients. Closing in favour of that broader fix.

@mandarini mandarini closed this Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unset auth.lockAcquireTimeout is forwarded as undefined, clobbering the 5000ms default and disabling lock-steal recovery (regression from the #2308 fix)

2 participants