[PR #6534] [MERGED] chore: async local storage fallback for convex #32330

Closed
opened 2026-04-17 23:10:22 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/6534
Author: @himself65
Created: 12/4/2025
Status: Merged
Merged: 12/5/2025
Merged by: @himself65

Base: canaryHead: himself65/2025/12/04/polyfill


📝 Commits (3)

📊 Changes

2 files changed (+42 additions, -4 deletions)

View changed files

packages/core/src/async_hooks/convex.spec.ts (+12 -0)
📝 packages/core/src/async_hooks/index.ts (+30 -4)

📄 Description

This is the fix for the convix.


Summary by cubic

Adds a safe AsyncLocalStorage polyfill and improves fallback behavior so environments without Node AsyncLocalStorage no longer crash.

  • Bug Fixes
    • Implemented AsyncLocalStoragePolyfill with run and getStore to emulate context storage and handle promises safely.
    • If AsyncLocalStorage is missing: browser returns null; server uses the polyfill when CONVEX_CLOUD_URL or CONVEX_SITE_URL are set; otherwise logs a warning.

Written for commit ac5e0f7ccd. Summary will update automatically on new commits.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/6534 **Author:** [@himself65](https://github.com/himself65) **Created:** 12/4/2025 **Status:** ✅ Merged **Merged:** 12/5/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `himself65/2025/12/04/polyfill` --- ### 📝 Commits (3) - [`45ec5f0`](https://github.com/better-auth/better-auth/commit/45ec5f090c2154e865677f23d8d8be8b71d0d1fe) fix: async local storage polyfill - [`17080cd`](https://github.com/better-auth/better-auth/commit/17080cd2816a5cb183f7221f2e0253d6b02cb59c) revert - [`ac5e0f7`](https://github.com/better-auth/better-auth/commit/ac5e0f7ccd275ed4e1a8793db733d42ac1e83983) fix: convex ### 📊 Changes **2 files changed** (+42 additions, -4 deletions) <details> <summary>View changed files</summary> ➕ `packages/core/src/async_hooks/convex.spec.ts` (+12 -0) 📝 `packages/core/src/async_hooks/index.ts` (+30 -4) </details> ### 📄 Description This is the fix for the convix. <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Adds a safe AsyncLocalStorage polyfill and improves fallback behavior so environments without Node AsyncLocalStorage no longer crash. - **Bug Fixes** - Implemented AsyncLocalStoragePolyfill with run and getStore to emulate context storage and handle promises safely. - If AsyncLocalStorage is missing: browser returns null; server uses the polyfill when CONVEX_CLOUD_URL or CONVEX_SITE_URL are set; otherwise logs a warning. <sup>Written for commit ac5e0f7ccd275ed4e1a8793db733d42ac1e83983. Summary will update automatically on new commits.</sup> <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-17 23:10:22 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#32330