[PR #7533] [MERGED] chore(core): improve runInBackground API type #15628

Closed
opened 2026-04-13 10:08:50 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/7533
Author: @himself65
Created: 1/21/2026
Status: Merged
Merged: 1/22/2026
Merged by: @himself65

Base: canaryHead: himself65/2026/01/21/background


📝 Commits (8)

📊 Changes

4 files changed (+14 additions, -16 deletions)

View changed files

📝 packages/better-auth/src/plugins/api-key/api-key.test.ts (+6 -6)
📝 packages/better-auth/src/plugins/api-key/routes/verify-api-key.ts (+3 -5)
📝 packages/core/src/types/context.ts (+4 -4)
📝 packages/core/src/types/init-options.ts (+1 -1)

📄 Description

Summary by cubic

Standardized background task typing by changing runInBackground to accept Promise and updating runInBackgroundOrAwait to return an Awaitable. Cleaned up API key verification by removing a no-op .then().

  • Refactors
    • Updated types across AuthContext and BetterAuthAdvancedOptions: runInBackground(promise: Promise) => void; runInBackgroundOrAwait(promise: Promise | void) => Awaitable.
    • Removed redundant .then(() => {}) in validateApiKey; errors are still logged.

Written for commit b611b572b4. Summary will update 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/7533 **Author:** [@himself65](https://github.com/himself65) **Created:** 1/21/2026 **Status:** ✅ Merged **Merged:** 1/22/2026 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `himself65/2026/01/21/background` --- ### 📝 Commits (8) - [`4df50bb`](https://github.com/better-auth/better-auth/commit/4df50bbff0be3a3d3613ba0c8a9044ffabeb9f43) chore(core): improve `runInBackground` API type - [`b59e499`](https://github.com/better-auth/better-auth/commit/b59e4991c336f33fefdf4680ef0ef47a9b9f0fb6) chore: lint fix - [`189f9e3`](https://github.com/better-auth/better-auth/commit/189f9e3324b032e5134e38c286aa8d50180050d3) chore: type fix - [`b782054`](https://github.com/better-auth/better-auth/commit/b782054567de61ea98ac41c51cf59965639acba0) chore: type fix - [`a45c8b5`](https://github.com/better-auth/better-auth/commit/a45c8b56d26cdc0a2e7a125a119ad89b0beabde9) improve - [`9e13c64`](https://github.com/better-auth/better-auth/commit/9e13c6401a76d957437de93df982a3bf8b933c63) improve - [`26803f7`](https://github.com/better-auth/better-auth/commit/26803f7f103f9b8e1ece34a5db9b2a483eaac239) lint - [`b611b57`](https://github.com/better-auth/better-auth/commit/b611b572b4472db9c19907ec22207f57fe20f5b7) fix: api key ### 📊 Changes **4 files changed** (+14 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/plugins/api-key/api-key.test.ts` (+6 -6) 📝 `packages/better-auth/src/plugins/api-key/routes/verify-api-key.ts` (+3 -5) 📝 `packages/core/src/types/context.ts` (+4 -4) 📝 `packages/core/src/types/init-options.ts` (+1 -1) </details> ### 📄 Description <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Standardized background task typing by changing runInBackground to accept Promise<unknown> and updating runInBackgroundOrAwait to return an Awaitable. Cleaned up API key verification by removing a no-op .then(). - **Refactors** - Updated types across AuthContext and BetterAuthAdvancedOptions: runInBackground(promise: Promise<unknown>) => void; runInBackgroundOrAwait(promise: Promise<unknown> | void) => Awaitable<unknown>. - Removed redundant .then(() => {}) in validateApiKey; errors are still logged. <sup>Written for commit b611b572b4472db9c19907ec22207f57fe20f5b7. Summary will update 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-13 10:08:50 -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#15628