Make account name optional and default to email#106
Conversation
emreertunc
left a comment
There was a problem hiding this comment.
Thanks for the implementation. I found one issue that needs to be fixed before approval.
The OAuth and auth.json import flows now pass the raw account name instead of the previously trimmed value. For example, " Work " was previously stored as "Work", but this PR preserves the surrounding whitespace.
Since duplicate-name validation uses exact string comparison, "Work" and " Work " can be added as separate accounts even though they appear identical in the UI.
Please keep the name optional while continuing to normalize explicit names with name.trim(), either before sending them or in the backend.
|
Thanks for catching this. Explicit account names are now trimmed centrally in the Rust account-creation path, while blank names still resolve to email/account-ID fallback. I also updated the focused test to cover whitespace normalization. Frontend production build and rustfmt check pass; focused Rust tests remain blocked locally by the missing MSVC link.exe toolchain component. |
emreertunc
left a comment
There was a problem hiding this comment.
Thanks for fixing the original whitespace issue. The explicit account name is now normalized correctly, but centralizing the trim in StoredAccount introduces an inconsistency in slim backup imports.
Slim payload validation and active_name comparisons still use the original untrimmed names, while restored accounts now have trimmed names. For example, if " Second " is the active account, it is restored as "Second". The active-name lookup then fails and silently selects the first account instead.
Duplicate-name validation has the same normalization mismatch.
Please apply the same name normalization consistently to slim account names, active_name, existing-name checks, and restored names, or limit trimming to the new OAuth/auth.json input paths.
|
Fixed in df8f81a. Trimming is now limited to the OAuth and auth.json entry points, so slim backup names and active-name matching remain unchanged. Added an auth.json trim test; frontend build and rustfmt pass. |
|
Thanks for the contribution! |
Improves account setup UX by allowing the name to be left blank. OAuth and auth.json imports now use the account email when available, with a short account-ID fallback otherwise; explicit names and existing accounts remain unchanged. Added focused Rust coverage for OAuth/import name resolution.