Skip to content

Conversation

@jonathannorris
Copy link
Member

@jonathannorris jonathannorris commented Jun 5, 2025

🐛 Fix UserBuilder validation logic

  • Fixed validation: Now throws UserError.MissingUserIdAndIsAnonymousFalse when isAnonymous=false but no valid userId provided
  • Simplified logic: Removed premature side effects from userId() and isAnonymous() methods
  • Better empty handling: Whitespace-only userIds are trimmed and treated as empty
  • Added tests: Comprehensive coverage for all user creation scenarios

⚠️ Breaking: builder().isAnonymous(false).build() now throws an error instead of silently creating anonymous user

Base automatically changed from chore-flutter-update-pr to main June 5, 2025 19:56
@jonathannorris jonathannorris force-pushed the fix-user-builder-validation branch from 131004e to 2c48210 Compare June 5, 2025 20:04
@jonathannorris jonathannorris requested a review from JamieSinn June 5, 2025 20:12
@jonathannorris jonathannorris merged commit 36beb11 into main Jun 5, 2025
14 of 17 checks passed
@jonathannorris jonathannorris deleted the fix-user-builder-validation branch June 5, 2025 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants