[PR #5852] fix: update hooks return should merge with original data #14524

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

Original Pull Request: https://github.com/better-auth/better-auth/pull/5852

State: closed
Merged: Yes


Summary by cubic

Fixes database update hooks to merge returned data with the original payload so partial updates don’t drop fields.

  • Bug Fixes

    • Merge hook result { data } into existing data instead of replacing it.
    • Preserve original fields when hooks return partial patches.
  • Refactors

    • Add session update hook to organization test setup.

Written for commit 78880a7d35. Summary will update automatically on new commits.

**Original Pull Request:** https://github.com/better-auth/better-auth/pull/5852 **State:** closed **Merged:** Yes --- <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Fixes database update hooks to merge returned data with the original payload so partial updates don’t drop fields. - **Bug Fixes** - Merge hook result `{ data }` into existing data instead of replacing it. - Preserve original fields when hooks return partial patches. - **Refactors** - Add session update hook to organization test setup. <sup>Written for commit 78880a7d3523a78e0cda0b2bd28160933a17640d. Summary will update automatically on new commits.</sup> <!-- End of auto-generated description by cubic. -->
GiteaMirror added the pull-request label 2026-04-13 09:31:12 -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#14524