Send reveal_card_details reason from the missing-personal-details magic code page#96733
Draft
MelvinBot wants to merge 2 commits into
Draft
Send reveal_card_details reason from the missing-personal-details magic code page#96733MelvinBot wants to merge 2 commits into
MelvinBot wants to merge 2 commits into
Conversation
Co-authored-by: Olly <Ollyws@users.noreply.github.com>
Co-authored-by: Olly <Ollyws@users.noreply.github.com>
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation of Change
When an account is missing personal details, pressing Reveal on a virtual Expensify Card routes into the
MissingPersonalDetailsflow, which ends onMissingPersonalDetailsMagicCodePage. That page requested the magic code with no reason (requestValidateCodeAction()), so the backend fell back to the generic "Log in to your account or access a secure feature." email instead of the card-specific "…Reveal details for your Expensify card ending in NNNN" copy.The sibling direct-reveal page (
ExpensifyCardVerifyAccountPage) already passesreasonCode: reveal_card_details+reasonCardID; this path was simply never migrated. This PR makesMissingPersonalDetailsMagicCodePagesupply the same reason only when it is revealing a virtual card (isVirtualCard), mirroring the sibling page. The physical-card shipping variant that shares this page keeps the reason-less call, since its magic code authorizes shipping, not a reveal.Because the callback also backs the "Didn't receive a magic code?" resend, the resent email is corrected too. The change is type-safe: the
ResendValidateCodeParamsunion already forcesreasonCardIDto accompanyREVEAL_CARD_DETAILS.Note: the "Add personal info" form shown at step 4 is working as designed — revealing a virtual card requires legal name/DOB/address, so a brand-new account must complete them first. The defect addressed here is the email copy.
Fixed Issues
$ #96604
PROPOSAL: #96604 (comment)
Tests
// TODO: The human co-author must fill out the tests you ran before marking this PR as "ready for review".
// Please describe what tests you performed that validate your change worked.
Automated coverage added in this PR: unit tests in
tests/actions/UserTest.tsassert thatrequestValidateCodeActionforwards{reasonCode: reveal_card_details, reasonCardID}toRESEND_VALIDATE_CODEwhen revealing, andnullwhen called without params.Offline tests
QA Steps
// TODO: The human co-author must fill out the QA tests you ran before marking this PR as "ready for review".
// Please describe what QA needs to do to validate your changes and what areas they need to test for regressions.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari