[PR #5205] [CLOSED] test: should emit warning on als not available #14096

Closed
opened 2026-04-13 09:18:44 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/5205
Author: @himself65
Created: 10/10/2025
Status: Closed

Base: canaryHead: himself65/2025/10/09/trx


📝 Commits (1)

  • 6e0aeb3 test: should emit warning on als not available

📊 Changes

2 files changed (+23 additions, -10 deletions)

View changed files

packages/better-auth/src/context/transaction.test.ts (+15 -0)
📝 packages/better-auth/src/context/transaction.ts (+8 -10)

📄 Description

Summary by cubic

Emit a warning and fall back to the provided adapter when Node AsyncLocalStorage is unavailable. Adds a test to verify the warning and fallback behavior.

  • Bug Fixes

    • Initialize the called flag to false in runWithAdapter and runWithTransaction to ensure the catch path warns and uses the fallback.
    • getCurrentAdapter now reliably returns the fallback when ALS fails or has no store.
  • Refactors

    • Removed BetterAuthOptions generics from DBAdapter and DBTransactionAdapter types.

🔄 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/5205 **Author:** [@himself65](https://github.com/himself65) **Created:** 10/10/2025 **Status:** ❌ Closed **Base:** `canary` ← **Head:** `himself65/2025/10/09/trx` --- ### 📝 Commits (1) - [`6e0aeb3`](https://github.com/better-auth/better-auth/commit/6e0aeb32461a9f18ac2b7c2b9171fa6f78b6cefd) test: should emit warning on als not available ### 📊 Changes **2 files changed** (+23 additions, -10 deletions) <details> <summary>View changed files</summary> ➕ `packages/better-auth/src/context/transaction.test.ts` (+15 -0) 📝 `packages/better-auth/src/context/transaction.ts` (+8 -10) </details> ### 📄 Description <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Emit a warning and fall back to the provided adapter when Node AsyncLocalStorage is unavailable. Adds a test to verify the warning and fallback behavior. - **Bug Fixes** - Initialize the called flag to false in runWithAdapter and runWithTransaction to ensure the catch path warns and uses the fallback. - getCurrentAdapter now reliably returns the fallback when ALS fails or has no store. - **Refactors** - Removed BetterAuthOptions generics from DBAdapter and DBTransactionAdapter types. <!-- 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-13 09:18:44 -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#14096