Skip to content

feat(@convex-dev/better-auth): add bridge race patches (pr368)#33

Merged
ramonclaudio merged 2 commits into
mainfrom
feat/convex-better-auth-pr368
May 12, 2026
Merged

feat(@convex-dev/better-auth): add bridge race patches (pr368)#33
ramonclaudio merged 2 commits into
mainfrom
feat/convex-better-auth-pr368

Conversation

@ramonclaudio

Copy link
Copy Markdown
Owner

Add bun/npm/pnpm patches for @convex-dev/better-auth@0.12.2 that wrap fetchAccessToken in new Promise() so useConvexAuth().isAuthenticated flips after sign-in on Hermes V1. From get-convex/better-auth#368.

The Expo SDK 56 canary dropped @babel/plugin-transform-async-to-generator from its Hermes V1 preset (expo/expo#45345). The transform was forcing async functions to wait an extra tick before resolving, hiding a bridge race in fetchAccessToken. Without it, two back-to-back auth calls race, Convex sees a stale config version, and silently skips reconnecting the socket. The explicit new Promise(executor) wrapper restores the one-tick delay.

  • patches: bun, npm (patch-package), pnpm variants under packages/@convex-dev/better-auth/
  • README.md: add entry to the open table

@ramonclaudio ramonclaudio merged commit 53e38d3 into main May 12, 2026
@ramonclaudio ramonclaudio deleted the feat/convex-better-auth-pr368 branch May 12, 2026 22:56
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.

1 participant