[PR #5779] fix(adapter): should not apply defaultValue during find calls #14466

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

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

State: closed
Merged: Yes


Summary by cubic

Fixes adapter default value handling to apply defaults only during create, never during find, and to not override explicit nulls for non-required fields. Adds tests for user additionalFields and a plugin model to verify testField defaults to "test-value", cbDefaultValueField resolves to "advanced-test-value", IDs are strings, and explicit nulls remain null when retrieved.

Written for commit 0ccecbed48. Summary will update automatically on new commits.

**Original Pull Request:** https://github.com/better-auth/better-auth/pull/5779 **State:** closed **Merged:** Yes --- <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Fixes adapter default value handling to apply defaults only during create, never during find, and to not override explicit nulls for non-required fields. Adds tests for user additionalFields and a plugin model to verify testField defaults to "test-value", cbDefaultValueField resolves to "advanced-test-value", IDs are strings, and explicit nulls remain null when retrieved. <sup>Written for commit 0ccecbed4853c676a63af4a4697e2f6639d52a9a. 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:29:20 -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#14466