[PR #4616] [MERGED] test: add tests to make sure after hook runs after db update #5484

Closed
opened 2026-03-13 12:24:32 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/4616
Author: @frectonz
Created: 9/12/2025
Status: Merged
Merged: 9/13/2025
Merged by: @himself65

Base: canaryHead: fix/after-hooks-runs-after-db-update


📝 Commits (2)

  • 4c11fe5 test: add tests to make sure after hook runs after db update
  • c52fc46 Merge branch 'canary' into fix/after-hooks-runs-after-db-update

📊 Changes

1 file changed (+71 additions, -1 deletions)

View changed files

📝 packages/better-auth/src/db/internal-adapter.test.ts (+71 -1)

📄 Description

closes #4614


Summary by cubic

Adds a test that verifies user.create.after runs after the DB write during sign-up and is called once, closing #4614. It uses in-memory SQLite (Kysely) and fetches the user inside the hook to assert the persisted fields match.


🔄 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/4616 **Author:** [@frectonz](https://github.com/frectonz) **Created:** 9/12/2025 **Status:** ✅ Merged **Merged:** 9/13/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `fix/after-hooks-runs-after-db-update` --- ### 📝 Commits (2) - [`4c11fe5`](https://github.com/better-auth/better-auth/commit/4c11fe5fd630b7f24ffa9fd265390a1b73def8ec) test: add tests to make sure after hook runs after db update - [`c52fc46`](https://github.com/better-auth/better-auth/commit/c52fc4634b092b2969cae9f8746efbce7ad8092c) Merge branch 'canary' into fix/after-hooks-runs-after-db-update ### 📊 Changes **1 file changed** (+71 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/db/internal-adapter.test.ts` (+71 -1) </details> ### 📄 Description closes #4614 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Adds a test that verifies user.create.after runs after the DB write during sign-up and is called once, closing #4614. It uses in-memory SQLite (Kysely) and fetches the user inside the hook to assert the persisted fields match. <!-- 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-03-13 12:24:32 -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#5484