fix: login flow properly shows invalid email#7802
fix: login flow properly shows invalid email#7802lorenzo-ranciaffi wants to merge 5 commits intodevfrom
Conversation
|
Windows and Mac build successful in Unity Cloud! You can find a link to the downloadable artifact below. |
RominaMarchetti
left a comment
There was a problem hiding this comment.
The flow is now working as expected: email validation happens before proceeding to the verification code view. No connection modal appearing anymore but the email error when it's invalid.
Evidence
https://github.com/user-attachments/assets/4eb9d695-1d2c-4f36-be3b-baf38183f4de
DafGreco
left a comment
There was a problem hiding this comment.
✔️ PR reviewed and approved by QA on both platforms following instructions playing both happy and un-happy path
Regressions for this ticket had been performed in order to verify that the normal flow is working as expected:
- [✔️ ] Log In/Log Out
- [ ✔️] Backpack and wearables in world
- [ ✔️] Emotes in world and in backpack
- [ ✔️] Teleport with map/coordinates/Jump In
- [ ✔️] Chat and multiplayer
- [ ✔️] Profile card
- [ ✔️] Camera
- [ ✔️] Skybox
- [ ✔️] Settings
Evidence:
Screen.Recording.2026-03-26.at.10.18.57.mov
20260326-1016-41.2819788.mp4
Explorer/Assets/DCL/AuthenticationScreenFlow/States/LoginSelectionAuthState.cs
Outdated
Show resolved
Hide resolved
Explorer/Assets/DCL/AuthenticationScreenFlow/States/LoginSelectionAuthState.cs
Outdated
Show resolved
Hide resolved
@DafGreco , did you try to disconnect in this specific time window when loading spinner is shown? So the test is
|
|
@claude review |
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
decentraland-bot
left a comment
There was a problem hiding this comment.
Review Summary
Clean refactoring that splits the OTP login flow into two phases — SendOtpAsync (validates email, creates wallet, sends code) and the existing login flow (reuses pendingWallet if already created). The approach is sound. A few issues to address:
Issues
-
AuthStatusnot reset on error (Medium) — InOTPLoginAsync, whenSendOtpAsyncthrows (non-cancellation), the method sets the error state on the input field and returns, butcurrentState.ValueremainsAuthStatus.LoginRequested. This may leave the UI in an inconsistent state (e.g. other buttons disabled). Consider resetting it back toLoginSelectionScreenin the catch blocks. -
Caught exception
eis unused (Low) — In the genericcatch (Exception e)block inOTPLoginAsync, the exception is silently swallowed. Consider logging it viaReportHubso that failures (network errors, ThirdWeb SDK errors, etc.) are traceable in production. -
pendingWalletlifetime / reuse concern (Medium) —SendOtpAsyncsetsthis.pendingWalletonThirdWebLoginService. If the user tries to send OTP, it fails with a non-cancellation exception, and then the user tries again with a different email — the oldpendingWalletis overwritten, which is fine. But if the user cancels (OperationCanceledException),pendingWalletcould be left in a partially-initialized state (wallet created but OTP not sent). On a subsequent call,OTPLoginFlowAsyncwould seependingWallet != nulland skipSendOtpAsync, proceeding to wait for an OTP that was never sent. Consider nullifyingpendingWalleton cancellation inSendOtpAsync, or always checking wallet state before reuse. -
Minor:
email!null-forgiving inOTPLoginFlowAsync— Theemail!on lineawait SendOtpAsync(email!, ct)relies on the caller having validated the email.SendOtpAsyncalready checks for null/empty and throws, so this is safe at runtime, but it might be clearer to validate earlier or document the contract.
Explorer/Assets/DCL/AuthenticationScreenFlow/States/LoginSelectionAuthState.cs
Outdated
Show resolved
Hide resolved
Explorer/Assets/DCL/AuthenticationScreenFlow/States/LoginSelectionAuthState.cs
Outdated
Show resolved
Hide resolved
Explorer/Assets/DCL/Web3/Authenticators/Implementations/ThirdWeb/ThirdWebLoginService.cs
Outdated
Show resolved
Hide resolved
PR 7802PR number: 7802 Intel Core i3Change samples: 2668
|
|
@claude re-review |
|
Claude finished @lorenzo-ranciaffi's task in 3m 57s —— View job Re-review of PR #7802
Previous issues addressed ✅All main concerns from the prior review have been resolved:
Network disconnect scenario (@popuz concern)The concern about a broken connection showing "invalid email" instead of a connection error is correctly handled: One minor nitLeft an inline suggestion on line 191 — REVIEW_RESULT: PASS ✅ |
Explorer/Assets/DCL/AuthenticationScreenFlow/States/LoginSelectionAuthState.cs
Outdated
Show resolved
Hide resolved
|
Claude finished @lorenzo-ranciaffi's task in 4m 26s —— View job PR #7802 Review
ReviewAll previous concerns have been addressed. One minor issue remains:
In Consider adding catch (Exception ex) when (ContainsInvalidEmailError(ex))
{
pendingWallet = null;
throw new InvalidEmailException(ex.Message, ex);
}This is low severity given the overwrite-on-next-call guarantee, but it makes the invariant explicit: REVIEW_RESULT: PASS ✅ |
|
@claude re-review and approve if passes |
|
Claude finished @lorenzo-ranciaffi's task in 1m 17s —— View job Re-review of PR #7802
Previous issues addressed ✅All concerns from the prior reviews have been resolved:
No blocking issues found. REVIEW_RESULT: PASS ✅ |
|
🔍 Claude reviewed this PR and found no blocking issues, but assessed it as complex — human DEV review is still required before merging. |
Pull Request Description
Fixes #6971
Figma
What does this PR change?
Adds the management of the otp code send so that the UI can properly react to failures caused by invalid emails.
The main idea is to handle the invalid email exception + have an event fired after a successful otp send so that the UI can react to that and proceed with the OTP validation
Test Instructions
Test Steps
Quality Checklist
Code Review Reference
Please review our Code Review Standards before submitting.