Skip to content

Conversation

@deevus
Copy link
Contributor

@deevus deevus commented Nov 25, 2025

Summary

  • Add primaryEmailAddressId, primaryPhoneNumberId, and primaryWeb3WalletId parameters to Api.updateUser() and Auth.updateUser()
  • Fix firstName comparison bug (was comparing against username instead of firstName)
  • Add comprehensive integration tests for both Auth and API layers

Test plan

  • Auth layer tests for primary email/phone updates
  • API layer tests for primary email/phone updates
  • Web3 wallet tests skipped (requires web3 wallet in test instance)
  • All existing tests pass

Note:
I had to edit the fixtures to differentiate the replaced identifiers

The validation logic was incorrectly comparing the firstName field against user.username instead of user.firstName. This fix ensures that when checking if the first name has changed, the comparison uses the correct field, preventing false positives in change detection for user profile updates.
Add comprehensive test coverage for updating user primary contact details through the Clerk API, including:

- Test for changing the primary email address to a secondary email and restoring the original
- Test for changing the primary phone number to a secondary phone and restoring the original
- Mock API response fixtures for both email and phone update workflows
- Validation that primary identifier changes are properly reflected in the user object and client session
@slightfoot slightfoot requested a review from shinyford November 27, 2025 09:58
@slightfoot slightfoot added bug Something isn't working enhancement New feature or request clerk_auth package: clerk_auth clerk_flutter package: clerk_flutter labels Nov 27, 2025
@slightfoot slightfoot added this to the v0.0.14-beta milestone Nov 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working clerk_auth package: clerk_auth clerk_flutter package: clerk_flutter enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants