CCCT-2407 Wire Email Entry Into PersonalID Signup And Recovery Flow#3735
CCCT-2407 Wire Email Entry Into PersonalID Signup And Recovery Flow#3735Jignesh-dimagi wants to merge 2 commits into
Conversation
Routes the Backup Code step into the Email entry screen so the email feature
is actually reachable end-to-end:
- Signup with email_otp_verification toggle ON → navigate to Email entry.
- Signup with toggle OFF → continue straight to Photo Capture (unchanged).
- Recovery with toggle ON and no server-returned email → Email entry.
- Recovery with toggle ON and a server-returned email, or toggle OFF →
finalize recovery via PersonalIdRecoveryCompleter and navigate to the
success message screen.
navigateToEmail() stamps PersonalIDPreferences.setLastEmailOfferDate(now) so
the future 30-day re-prompt gate starts from when the offer is presented,
and selects EmailWorkFlow.RECOVERY or .REGISTRATION based on flow.
PhotoCapture.createAndSaveConnectUser now writes
user.setEmail(personalIdSessionData.getEmail()) so the verified address
persists on the new ConnectUserRecord. Mirrors the symmetric write inside
PersonalIdRecoveryCompleter for the recovery path.
PersonalIdRecoveryCompleter KDoc updated to reflect that the CCCT-2407 /
CCCT-2378 TODOs are now satisfied.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Suggested Review Order
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## ccct-2377-email-entry-fragment #3735 +/- ##
=================================================================
Coverage 23.29% 23.30%
- Complexity 3938 3942 +4
=================================================================
Files 929 929
Lines 56456 56486 +30
Branches 6707 6719 +12
=================================================================
+ Hits 13152 13164 +12
- Misses 41601 41618 +17
- Partials 1703 1704 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
conroy-ricketts
left a comment
There was a problem hiding this comment.
LGTM! Just had one minor comment
| - **Recovery with the server already returning a verified email for the user:** Walk PersonalID account recovery (validate backup code on a new device). Verify the flow skips the Email screen entirely and goes directly to the "Account Recovered" success screen. | ||
| - **Recovery with no server email, `email_otp_verification` toggle ON:** Recover an account that has no email on file. After backup code validation, verify the Email entry screen appears (so the user can add an email during recovery). | ||
| - **Recovery with `email_otp_verification` toggle OFF:** Recover any account with the toggle disabled. Verify the flow goes directly from backup code to the "Account Recovered" success screen without the Email screen. | ||
| - **Email persisted on the user record:** After completing a signup that included entering and verifying an email, verify the HQ admin view of the PersonalID user shows the email address that was entered. Repeat the same check after a recovery that included the Email screen. |
There was a problem hiding this comment.
QA won't have access to the admin tool right?
There was a problem hiding this comment.
right, think QA can verify this by just checking if they don't get asked the email again while recovering the account.
There was a problem hiding this comment.
Yeah, I have thought about this line while committing but ultimately kept it so that QA is aware to verify the email address, either by viewing it on the dashboard (if possible, like the phone number) or, as @shubham1g5 suggested, to verify it by application flow, by recovering the same account.
CCCT-2407
Product Description
Connects the Email entry screen into the live PersonalID flow. After this PR the email step is actually reachable from a running app:
email_otp_verificationtoggle is active; otherwise the flow continues straight to Photo Capture as before.ConnectUserRecord.emailat signup completion (Photo Capture) and at recovery completion (PersonalIdRecoveryCompleter), so it's visible on the HQ admin view of the PersonalID user.Technical Summary
PersonalIdBackupCodeFragment.handleBackupCodeSubmission()(signup branch) andhandleConfirmBackupCodeSuccess()(recovery branch) now readReleaseToggleHelper.isEmailOtpVerificationActive(personalIdSessionData)against the in-flight session'sfeatureReleaseToggleslist and branch accordingly. Recovery additionally short-circuits to the success screen whenpersonalIdSessionData.getEmail() != null(the server already has a verified address).navigateToEmail()helper stampsPersonalIDPreferences.setLastEmailOfferDate(now)whenever the screen is shown (anchor for the future 30-day re-prompt gate), selectsEmailWorkFlow.RECOVERYorEmailWorkFlow.REGISTRATIONbased onisRecovery, and navigates via the new Safe Args actionactionPersonalidBackupcodeToPersonalidEmail(workflow).action_personalid_backupcode_to_personalid_emailinnav_graph_personalid.xml(no arg overrides — destination's requiredworkflow: EmailWorkFlowarg is passed by the caller).PersonalIdPhotoCaptureFragment.createAndSaveConnectUser()now writesuser.setEmail(personalIdSessionData.getEmail())before storing the record. Mirrors the symmetric write insidePersonalIdRecoveryCompleter.finalizeAccountRecovery. The constructor signature forConnectUserRecordis unchanged; the email is set via the setter post-construction.PersonalIdRecoveryCompleterKDoc updated to remove the CCCT-2407 / CCCT-2378 TODOs that are now satisfied and restate which callsites invoke it.Safety Assurance
Safety story
What gives confidence:
email_otp_verificationtoggle ON (Email screen appears after Backup Code), signup with the toggle OFF (skips straight to Photo Capture), recovery with a server-returned email (skips Email and goes straight to Recovery Success), and recovery with no server email and the toggle ON (Email screen appears so the user can add one).ReleaseToggleHelper.isEmailOtpVerificationActive(...)— the toggle-off branches are byte-equivalent to the pre-PR behavior (signup → Photo, recovery → finalize + success).PersonalIdRecoveryCompleteremail-persistence writes are symmetric: sameuser.email = sessionData.emailshape on both paths, withsessionData.emailpopulated only by the OTP-verify success callback (sessionData.email != nullremains a strict synonym for "verified").EmailWorkFlowandactionPersonalidBackupcodeToPersonalidEmail, both introduced in CCCT-2377 Add Email Entry Fragment To PersonalID Flow #3729 (the base of this PR) — Safe Args compiles cleanly against that.Risks to review:
navigateToSuccess()path is unchanged so the regression risk is limited to "did the toggle check evaluate correctly when off in recovery", but the codepath itself was not run.PersonalIdRecoveryCompleter(which is server-tested in earlier flows), but the end-to-end "HQ shows the email" verification was not performed.PersonalIDPreferences.setLastEmailOfferDate(now)is written eagerly the momentnavigateToEmail()is invoked, before the user has interacted with the screen. If the user backs out without skipping or completing, the offer-date is still consumed. Acceptable given the 30-day cadence, but worth confirming with product.isEmailOtpVerificationActive(personalIdSessionData)), which reads the toggle list that came back from/users/start_configurationfor the current in-flight session — fresh and authoritative for signup/recovery, but does not cover legacy users who land here via a different entry point (none exist today; this is only relevant once the legacy add-email path lands).EmailWorkFlow, the email-entry destination args, orPersonalIdRecoveryCompleter.finalizeAccountRecovery's signature on that branch will rebase into here.Automated test coverage
PersonalIdEmailFragmentTest(8 cases) andPersonalIdPhoneFragmentTest(12 cases) continue to pass — the sharedBasePersonalIdConfigurationTestis unchanged on this branch.PersonalIdBackupCodeFragmentrouting branches themselves (signup/recovery × toggle on/off × email present/null), thePersonalIDPreferences.setLastEmailOfferDate(now)side effect innavigateToEmail, and thePhotoCapture.createAndSaveConnectUseremail-persistence write. Coverage is left to the manual QA steps inRELEASES.mdfor this release.