[$175] Expensify Card - Prompt users to complete private personal details before wallet enrollment
Version Number: N/A Reproducible in staging?: Yes Reproducible in production?: Yes Issue reported by: Rafe Colton Slack conversation: ECUK tokenization testing
Problem
Add a prompt to complete missing private personal details before starting Add to Wallet, matching the existing virtual card reveal flow.
Users should be able to provide the required details as part of wallet setup, without having to find and complete them separately in Settings.
Proposed Flow
- Open the details page for a virtual Expensify Card and select Add to Wallet.
- If required private personal details are missing, show the existing personal-details collection flow.
- After the user completes and successfully saves the details, continue to wallet enrollment.
- If the required details are already complete, proceed directly to wallet enrollment.
Expected Result
Before starting in-app wallet enrollment, require the necessary private personal details, matching the virtual card reveal flow's collection requirement.
If details are missing, open the collection flow. Save the details successfully before continuing to wallet enrollment. Users who already have complete details should proceed without entering them again.
Actual Result
The Add to Wallet action starts the wallet/MFA flow without the missing-personal-details prompt used by virtual card reveal.
Workaround
Users can complete private personal details separately in Settings before starting wallet enrollment.
Platforms
- The prompt was requested during iOS App testing with UK/EU cards.
- Cover both iOS and Android in-app enrollment.
Acceptance Criteria
- [ ] Confirm the required personal-details fields against the virtual card reveal flow.
- [ ] In-app UK/EU wallet enrollment prompts for required details when they are missing.
- [ ] Enrollment does not start until the details have been saved successfully.
- [ ] Canceling the collection flow or failing to save does not start enrollment.
- [ ] Users with complete details can continue without repeating the collection flow.
Scope
This issue covers using existing APIs to save personal details when the in-app Add to Wallet button is pressed. Enrollment started directly from the device's Wallet app is out of scope.
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~022120211810646931528
- Upwork Job ID: 2120211810646931528
- Last Price Increase: 2026-11-10
Issue Owner
Current Issue Owner: @parasharrajat
@chuckdries Eep! 4 days overdue now. Issues have feelings too...
Triggered auto assignment to Contributor-plus team member for initial proposal review - @parasharrajat (External)
Job added to Upwork: https://www.upwork.com/jobs/~022120211810646931528
Contributor details Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~013d295f05a578824b
Proposal
Please re-state the problem that we are trying to solve in this issue.
When an in-app user on native (iOS/Android) taps the Add to Wallet button (AddToWalletButton) on a virtual Expensify Card details page, the app immediately initiates digital wallet enrollment or executes the ADD_TO_DIGITAL_WALLET scenario without prompting the user to complete required private personal details (legal name, date of birth, phone number, and physical address with street, city, zip, country, and state/province) if they are missing.
What is the root cause of that problem?
-
Missing Precondition Check in
AddToWalletButton: Insrc/components/AddToWalletButton/index.native.tsx:const handleOnPress = () => { if (isUkEuExpensifyCard(card)) { executeScenario(CONST.MULTIFACTOR_AUTHENTICATION.SCENARIO.ADD_TO_DIGITAL_WALLET, {card, cardHolderName, cardDescription}); return; } setIsLoading(true); handleAddCardToWallet(card, cardHolderName, cardDescription) ... };AddToWalletButtondoes not subscribe to or inspectONYXKEYS.PRIVATE_PERSONAL_DETAILS. WhenhandleOnPressis invoked for a UK/EU card (or native wallet enrollment), it immediately triggersexecuteScenario(CONST.MULTIFACTOR_AUTHENTICATION.SCENARIO.ADD_TO_DIGITAL_WALLET, ...)without validating whether the user's KYC / private personal details are populated. -
Contrast with the Virtual Card Reveal Flow: In
src/pages/settings/Wallet/ExpensifyCardPage/index.tsx(the canonical virtual card reveal flow):if (areAddressAndPersonalDetailsMissing(privatePersonalDetails)) { Navigation.navigate(createDynamicRoute(DYNAMIC_ROUTES.MISSING_PERSONAL_DETAILS.getRoute(String(card.cardID)))); return; }The virtual card reveal flow uses
areAddressAndPersonalDetailsMissing(privatePersonalDetails)(defined insrc/libs/PersonalDetailsUtils.ts#L503), which strictly checks:legalFirstNamelegalLastNamedobphoneNumberaddresses[0]withstreet,city,zip,country, andstate/province. If any of these fields are missing, it redirects to the dedicated collection RHP viaDYNAMIC_ROUTES.MISSING_PERSONAL_DETAILS.AddToWalletButtoncurrently lacks this verification step.
What changes do you think we should make in order to solve the problem?
-
Update
src/components/AddToWalletButton/index.native.tsx:- Subscribe to
ONYXKEYS.PRIVATE_PERSONAL_DETAILSusinguseOnyx(ONYXKEYS.PRIVATE_PERSONAL_DETAILS). - Import
areAddressAndPersonalDetailsMissingfrom@libs/PersonalDetailsUtils,createDynamicRoutefrom@libs/Navigation/helpers/dynamicRoutesUtils/createDynamicRoute, andDYNAMIC_ROUTESfrom@src/ROUTES. - Maintain an awaiting state ref (e.g.
isAwaitingPersonalDetailsRef = useRef(false)) to detect when the user returns from saving details. - In
handleOnPress: WhenisUkEuExpensifyCard(card)is true:- Check
if (areAddressAndPersonalDetailsMissing(privatePersonalDetails)):- Set
isAwaitingPersonalDetailsRef.current = true. - Navigate to
createDynamicRoute(DYNAMIC_ROUTES.MISSING_PERSONAL_DETAILS.getRoute(String(card.cardID))). - Return early so enrollment is blocked.
- Set
- If details are complete, proceed directly with
executeScenario(CONST.MULTIFACTOR_AUTHENTICATION.SCENARIO.ADD_TO_DIGITAL_WALLET, {card, cardHolderName, cardDescription}).
- Check
- Add a reactive
useEffecton[privatePersonalDetails, card, cardHolderName, cardDescription, executeScenario]:- If
isAwaitingPersonalDetailsRef.currentistrueand!areAddressAndPersonalDetailsMissing(privatePersonalDetails):- Reset
isAwaitingPersonalDetailsRef.current = false. - Automatically trigger wallet enrollment:
executeScenario(CONST.MULTIFACTOR_AUTHENTICATION.SCENARIO.ADD_TO_DIGITAL_WALLET, {card, cardHolderName, cardDescription}).
- Reset
- If the user cancels the collection flow or closes the RHP without saving,
privatePersonalDetailsremains incomplete, soisAwaitingPersonalDetailsRef.currentstays guarded and enrollment does not start.
- If
- Subscribe to
-
Integration with
MissingPersonalDetails:- When the user completes the flow in
src/pages/MissingPersonalDetails/MissingPersonalDetailsContent.tsx, it executesSET_PERSONAL_DETAILS_AND_REVEAL_CARD_DETAILS, which callssetPersonalDetailsAndRevealExpensifyCardWithSCAto persist the details to the backend and merge them into OnyxPRIVATE_PERSONAL_DETAILS. - In
src/components/MultifactorAuthentication/config/scenarios/SetPersonalDetailsAndRevealCardDetails.tsx#L85, the callback closes the RHP (Navigation.closeRHPFlow()) and returns toDYNAMIC_ROUTES.WALLET_DOMAIN_CARD. - Upon return to
ExpensifyCardPage, the updatedprivatePersonalDetailsin Onyx satisfies!areAddressAndPersonalDetailsMissing(privatePersonalDetails)andAddToWalletButtonseamlessly launches theADD_TO_DIGITAL_WALLETenrollment.
- When the user completes the flow in
-
Automated Unit Tests in
tests/unit/components/AddToWalletButton.test.tsx:- Add test cases covering:
- Tapping Add to wallet for a UK/EU card when personal details are missing prompts the user by navigating to
DYNAMIC_ROUTES.MISSING_PERSONAL_DETAILSand does NOT startADD_TO_DIGITAL_WALLET. - When personal details are successfully populated in Onyx following the prompt,
ADD_TO_DIGITAL_WALLETstarts automatically. - Tapping Add to wallet when personal details are already complete proceeds directly to
ADD_TO_DIGITAL_WALLETwithout navigation to missing details. - Canceling or dismissing the collection flow leaves details incomplete and does not start enrollment.
- Tapping Add to wallet for a UK/EU card when personal details are missing prompts the user by navigating to
- Add test cases covering:
What alternative solutions did you explore? (Optional)
- Hiding the Add to Wallet button when details are missing:
- Rejected because hiding the button entirely makes digital wallet enrollment undiscoverable and prevents users from knowing they can add the card. Prompting users at the point of action matches the UX pattern established by virtual card reveal.
- Redirecting to General Profile Settings (
ROUTES.SETTINGS_PROFILE):- Rejected because general profile settings requires the user to manually find and edit multiple separate fields (Profile > Contact methods, Profile > Legal name, Profile > Address), whereas
DYNAMIC_ROUTES.MISSING_PERSONAL_DETAILSprovides a guided step-by-step wizard specifically built for cardholder KYC details.
- Rejected because general profile settings requires the user to manually find and edit multiple separate fields (Profile > Contact methods, Profile > Legal name, Profile > Address), whereas
— submitted with Antigravity on the contributor's behalf
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
@chuckdries Will you work on this?
@parasharrajat I was hoping we could get melvin or an external contributor to implement it
@MelvinBot Add a proposal for this issue.
Proposal
What is the root cause of that problem?
The native Add to Wallet button starts UK/EU wallet authentication immediately, without checking private personal details. Virtual card reveal performs that check first.
The existing collection flow also cannot be reused unchanged: completing it for a UK/EU virtual card saves details and reveals the card, rather than continuing wallet enrollment.
Code evidence and required fields
AddToWalletButton/index.native.tsx:28–40starts the wallet scenario without a completeness check.ExpensifyCardPage/index.tsx:543–568checks details before revealing a card.PersonalDetailsUtils.ts:485–513requires legal first/last name, date of birth, phone number, and an address containing street, city, postcode and country. The completeness check requires state only for US addresses.MissingPersonalDetailsContent.tsx:91–129currently completes through reveal/shipping-specific actions.
What changes do you think we should make in order to solve the problem?
-
Check before starting wallet authentication. In the native button’s UK/EU branch, reuse
areAddressAndPersonalDetailsMissing. Complete details continue directly; missing details open the existing collection flow. -
Give collection an explicit wallet purpose. Preserve that purpose and the target card through collection, editing and verification. This path must save details without revealing card credentials, ordering a card or collecting a shipping PIN. Existing reveal/shipping behavior remains unchanged.
-
Use the existing save-only API. Reuse
UpdatePrivatePersonalDetailsand its personal-details verification-code handling. Add an attempt-specific completion result so enrollment resumes only after that save succeeds—not when shared profile data happens to become complete. -
Make continuation cancelable and single-use. Bind the pending attempt to its card. Canceling, dismissing or leaving the flow invalidates it. A late response must not start enrollment. On matching success, consume the attempt once, close collection and start the existing
ADD_TO_DIGITAL_WALLETscenario.
Save implementation safeguards
PersonalDetails.ts:542–591 already saves the collected fields without revealing a card. Extend its existing success/failure updates with a request-correlated result while preserving current callers.
Do not treat awaiting the queued write as server confirmation. Also handle the queue’s AlreadyCreated exception fail-closed for this save: it must not authorize enrollment through the queue’s exceptional success-data path.
Regression coverage
- Missing details open collection before wallet authentication.
- Complete details proceed directly.
- Successful save starts enrollment for the correct card exactly once.
- Save failure, incorrect code, pending/offline save and cancellation never start enrollment.
- Late responses and unrelated profile updates cannot revive canceled enrollment.
- Wallet collection never reveals credentials; existing reveal/shipping flows remain unchanged.
This proposal is based on source inspection; native enrollment and navigation behavior have not been runtime-verified.
What alternative solutions did you explore? (Optional)
Watching profile completeness with an awaiting ref is insufficient: it does not establish that this enrollment attempt saved successfully, and canceled intent can remain armed. Reusing the unchanged save-and-reveal flow also introduces an unrelated card-reveal operation.
Next Steps for Contributor+ team:
To accept: @MelvinBot implement [this](https://github.com/Expensify/App/issues/106008) to create a draft PR.
To refine: @MelvinBot <your feedback>
To reject: Explain why you are rejecting Melvin's proposal.
Proposal
Please re-state the problem that we are trying to solve in this issue.
When a user taps Add to Wallet on an Expensify Card before completing their private personal details, tapping Add to Wallet fails/blocks wallet enrollment instead of guiding the user through completing their missing private personal details and then automatically resuming wallet enrollment once completed.
What is the root cause of that problem?
src/components/AddToWalletButton/index.native.tsx:34-38immediately callsexecuteScenario(CONST.MULTIFACTOR_AUTHENTICATION.SCENARIO.ADD_TO_DIGITAL_WALLET, {card, cardHolderName, cardDescription})wheneverisUkEuExpensifyCard(card)is true, without checking whether required private personal details (firstName,lastName,legalFirstName,legalLastName,dob,address,phoneNumber) are already present in Onyx.- Navigating directly to
DYNAMIC_ROUTES.MISSING_PERSONAL_DETAILS.getRoute(String(card.cardID))without an explicit wallet-enrollment intent is unsafe becauseMissingPersonalDetailsis tightly coupled to card shipping and PAN/CVV reveal flows:- In
src/pages/MissingPersonalDetails/MissingPersonalDetailsContent.tsx:76,const shouldCollectPIN = !!cardID && isUkEuExpensifyCard(targetCard) && !isVirtualCard;istruefor physical UK/EU cards — forcing the user through PIN creation and triggeringSET_PIN_ORDER_CARD(MissingPersonalDetailsContent.tsx:95-127) /SHIP_CARD(MissingPersonalDetailsValidateCodePage.tsx:98-126). - For virtual UK/EU cards (
isVirtualCard && isUkEuExpensifyCard(targetCard)),MissingPersonalDetailsContent.tsx:95-127andMissingPersonalDetailsValidateCodePage.tsx:98-126executeSET_PERSONAL_DETAILS_AND_REVEAL_CARD_DETAILS/REVEAL_CARD_DETAILS, revealing sensitive card details instead of enrolling the card in the digital wallet. - Neither path resumes
CONST.MULTIFACTOR_AUTHENTICATION.SCENARIO.ADD_TO_DIGITAL_WALLETafter details are saved.
- In
What changes do you think we should make in order to solve the problem?
Introduce an explicit wallet-enrollment purpose/mode for MissingPersonalDetails and wire a missing-details pre-check + auto-resume handoff in AddToWalletButton:
- Pre-check private personal details in
src/components/AddToWalletButton/index.native.tsx(and card wallet handler):- Check the user's private personal details in Onyx and evaluate completeness using
src/pages/MissingPersonalDetails/utils.tsbefore callingexecuteScenario(CONST.MULTIFACTOR_AUTHENTICATION.SCENARIO.ADD_TO_DIGITAL_WALLET, ...). - If required private personal details are incomplete, navigate to
MissingPersonalDetailswith an explicit wallet-enrollment intent (e.g., query/route param or Onyx pending wallet-enrollment state tied tocard.cardID) rather than launching the MFA wallet scenario prematurely.
- Check the user's private personal details in Onyx and evaluate completeness using
- Add a save-only wallet intent path in
src/pages/MissingPersonalDetails/(index.tsx,MissingPersonalDetailsContent.tsx,MissingPersonalDetailsValidateCodePage.tsx):- When the flow is entered for digital wallet enrollment:
- Set
shouldCollectPIN(MissingPersonalDetailsContent.tsx:76) tofalseeven for physical UK/EU Expensify cards (the user already owns/issued the card and only needs personal details saved before Apple/Google Pay provisioning). - Submit/save personal details via the private-personal-details update path (
UpdatePrivatePersonalDetails— or validate-code completion without card shipping or PAN/CVV reveal side effects) instead ofSET_PIN_ORDER_CARD,SHIP_CARD,SET_PERSONAL_DETAILS_AND_REVEAL_CARD_DETAILS, orREVEAL_CARD_DETAILS.
- Set
- When the flow is entered for digital wallet enrollment:
- Single-use resume into
ADD_TO_DIGITAL_WALLETMFA scenario:- Upon successful save of private personal details (and dismissal back to the card/wallet screen or via
onComplete), consume the single-use pending wallet-enrollment marker once and automatically triggerexecuteScenario(CONST.MULTIFACTOR_AUTHENTICATION.SCENARIO.ADD_TO_DIGITAL_WALLET, {card, cardHolderName, cardDescription})(or navigate back cleanly if the user cancels/closes without completing, clearing the pending marker so it never replays unexpectedly).
- Upon successful save of private personal details (and dismissal back to the card/wallet screen or via
- Tests:
- Add unit/navigation tests covering: (a) incomplete private personal details for physical & virtual UK/EU cards redirects to
MissingPersonalDetailswithout PIN prompt orSHIP_CARD/REVEAL_CARD_DETAILS, (b) completing details savesPRIVATE_PERSONAL_DETAILSand resumesADD_TO_DIGITAL_WALLETonce, and (c) cancelling clears pending resume state.
- Add unit/navigation tests covering: (a) incomplete private personal details for physical & virtual UK/EU cards redirects to
What alternative solutions did you explore?
Navigating directly to MissingPersonalDetails using only cardID without a wallet-enrollment flag would erroneously ask for a card PIN on physical UK/EU cards (shouldCollectPIN) or reveal PAN/CVV (SET_PERSONAL_DETAILS_AND_REVEAL_CARD_DETAILS) on virtual cards, and would leave the user back on the card page without resuming wallet enrollment. Scoping a dedicated wallet-enrollment intent + single-use resume avoids any regression to existing card ordering and card reveal flows.
Contributor details
- Your Expensify account email: [email protected]
📣 @almagas! 📣 Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork. Please follow these steps:
- Make sure you've read and understood the contributing guidelines.
- Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
- Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
- Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>
Proposal
Please re-state the problem that we are trying to solve in this issue.
When a user on iOS or Android taps Add to Wallet (AddToWalletButton) on an Expensify Card details page (ExpensifyCardPage) while their required private personal details are incomplete, the app immediately starts the ADD_TO_DIGITAL_WALLET MFA/wallet enrollment flow instead of prompting the user to complete and save their missing private personal details first (matching the virtual card reveal requirement) and then continuing to wallet enrollment once saved.
What is the root cause of that problem?
- No personal-details completeness check in
src/components/AddToWalletButton/index.native.tsx:34-38:- When
isUkEuExpensifyCard(card)is true,handleOnPressimmediately callsexecuteScenario(CONST.MULTIFACTOR_AUTHENTICATION.SCENARIO.ADD_TO_DIGITAL_WALLET, {card, cardHolderName, cardDescription})without checkingareAddressAndPersonalDetailsMissing(privatePersonalDetails)(defined insrc/libs/PersonalDetailsUtils.ts:503-514, which is used by the virtual card reveal flow insrc/pages/settings/Wallet/ExpensifyCardPage/index.tsx:549-552to requirelegalFirstName,legalLastName,dob,phoneNumber, andaddresses[0]withstreet,city,zip,country, andstatefor US addresses).
- When
MissingPersonalDetailscannot be navigated to with onlycardIDunchanged (src/pages/MissingPersonalDetails/MissingPersonalDetailsContent.tsx&MissingPersonalDetailsValidateCodePage.tsx):MissingPersonalDetailsContent.tsx:74-123branches exclusively oncardID,isVirtualCard, andisUkEuExpensifyCard(targetCard):- For physical UK/EU cards (
!isVirtualCard && isUkEuExpensifyCard(targetCard)), line76setsshouldCollectPIN = trueand line105executesSET_PIN_ORDER_CARD, which collects a shipping PIN and orders a card instead of saving personal details for wallet enrollment. - For virtual UK/EU cards (
isVirtualCard && isUkEuExpensifyCard(targetCard)), line115executesSET_PERSONAL_DETAILS_AND_REVEAL_CARD_DETAILS, which reveals sensitive PAN/CVV card credentials instead of only saving personal details.
- For physical UK/EU cards (
- Similarly,
MissingPersonalDetailsValidateCodePage.tsx:98-121branches only onisVirtualCard: callingsetPersonalDetailsAndRevealExpensifyCard(withVALIDATE_CODE_REASONS.REVEAL_CARD_DETAILS) for virtual cards orupdatePersonalDetailsAndShipExpensifyCards(withVALIDATE_CODE_REASONS.SHIP_CARD) for physical cards, rather than calling the save-onlyupdatePrivatePersonalDetailsaction (WRITE_COMMANDS.UPDATE_PRIVATE_PERSONAL_DETAILSwithCOMMON_CONST.VALIDATE_CODE_REASONS.UPDATE_PERSONAL_DETAILS).
- Why an unguarded
useEffectwatchingareAddressAndPersonalDetailsMissing(privatePersonalDetails)inAddToWalletButtonis unsafe:- If the user opens the missing-details flow from Add to Wallet and cancels/closes the RHP, or if an offline queued write has not yet been confirmed by the backend, leaving an armed
useRefwatcher inAddToWalletButtoncan unexpectedly launch wallet enrollment later when unrelated profile edits occur.
- If the user opens the missing-details flow from Add to Wallet and cancels/closes the RHP, or if an offline queued write has not yet been confirmed by the backend, leaving an armed
What changes do we think we should make in order to solve the problem?
-
Add an explicit wallet-enrollment mode to
DYNAMIC_ROUTES.MISSING_PERSONAL_DETAILSandDYNAMIC_ROUTES.MISSING_PERSONAL_DETAILS_CONFIRM_VALIDATE_CODE(src/ROUTES.ts,src/libs/Navigation/types.ts,src/pages/MissingPersonalDetails/index.tsx):- Allow
MISSING_PERSONAL_DETAILSandMISSING_PERSONAL_DETAILS_CONFIRM_VALIDATE_CODEto accept an optional query/route parameter (orisForDigitalWallet?: boolean/purpose?: 'wallet'onMissingPersonalDetailsParamList) so the flow knows it was launched from Add to Wallet forcardIDrather than card reveal or physical card shipping. - Forward
isForDigitalWalletfromMissingPersonalDetails/index.tsxintoMissingPersonalDetailsContentand intoDYNAMIC_ROUTES.MISSING_PERSONAL_DETAILS_CONFIRM_VALIDATE_CODE.getRoute(cardID, isForDigitalWallet).
- Allow
-
Use the save-only
updatePrivatePersonalDetailsflow whenisForDigitalWalletis active (src/pages/MissingPersonalDetails/MissingPersonalDetailsContent.tsx&MissingPersonalDetailsValidateCodePage.tsx):- In
MissingPersonalDetailsContent.tsx:- Set
const shouldCollectPIN = !isForDigitalWallet && !!cardID && isUkEuExpensifyCard(targetCard) && !isVirtualCard;so wallet enrollment never prompts for a shipping PIN. - In
handleFinishStep(lines91-123), whenisForDigitalWalletis true, bypass bothSET_PIN_ORDER_CARDandSET_PERSONAL_DETAILS_AND_REVEAL_CARD_DETAILSand callonComplete()directly to advance toMissingPersonalDetailsValidateCodePage.
- Set
- In
MissingPersonalDetailsValidateCodePage.tsx:- When
isForDigitalWalletis true:- Use
{reasonCode: COMMON_CONST.VALIDATE_CODE_REASONS.UPDATE_PERSONAL_DETAILS}forsendValidateCodeand passvalidateCodeReasonCode={COMMON_CONST.VALIDATE_CODE_REASONS.UPDATE_PERSONAL_DETAILS}andvalidateCodeActionErrorField="personalDetails"toValidateCodeActionContent(matchingPrivatePersonalDetailsConfirmValidateCodePage.tsx:74-78). - In
handleSubmitForm(validateCode), callupdatePrivatePersonalDetails(values, validateCode, countryCode)(src/libs/actions/PersonalDetails.ts:542). - Track the in-flight save with a
wasSavingForWalletRefwatchingprivatePersonalDetails?.isLoadingtransitioning fromtrue -> falsewith!hasErrorsand!areAddressAndPersonalDetailsMissing(privatePersonalDetails)( matchingPrivatePersonalDetailsConfirmValidateCodePage.tsx:46-58). When the save succeeds on the server, record the completed wallet-readycardID(via a single-use callback/store or Onyx RAM-only state), callclearDraftValues(ONYXKEYS.FORMS.PERSONAL_DETAILS_FORM), and close the RHP (Navigation.closeRHPFlow()).
- Use
- When
- In
-
Gate
AddToWalletButtononareAddressAndPersonalDetailsMissingand resume enrollment once on verified completion (src/components/AddToWalletButton/index.native.tsx):- Subscribe to
const [privatePersonalDetails] = useOnyx(ONYXKEYS.PRIVATE_PERSONAL_DETAILS);. - In
handleOnPress:- When
isUkEuExpensifyCard(card)is true andareAddressAndPersonalDetailsMissing(privatePersonalDetails)is true:- Register a pending single-use wallet enrollment intent bound to
card.cardID(cleared automatically if the user dismisses/cancels theMissingPersonalDetailsRHP without completing the save) and navigate tocreateDynamicRoute(DYNAMIC_ROUTES.MISSING_PERSONAL_DETAILS.getRoute(String(card.cardID), undefined, undefined, true)). - Return early without starting
ADD_TO_DIGITAL_WALLET.
- Register a pending single-use wallet enrollment intent bound to
- When details are already complete (
!areAddressAndPersonalDetailsMissing(privatePersonalDetails)), immediately callexecuteScenario(CONST.MULTIFACTOR_AUTHENTICATION.SCENARIO.ADD_TO_DIGITAL_WALLET, {card, cardHolderName, cardDescription}).
- When
- When
MissingPersonalDetailsValidateCodePagefinishes savingUpdatePrivatePersonalDetailsforcard.cardIDand closes the RHP, consume the single-use completion token forcard.cardIDonce and invokeexecuteScenario(CONST.MULTIFACTOR_AUTHENTICATION.SCENARIO.ADD_TO_DIGITAL_WALLET, {card, cardHolderName, cardDescription}).
- Subscribe to
What alternative solutions did you explore? (Optional)
- Navigating to
DYNAMIC_ROUTES.MISSING_PERSONAL_DETAILS.getRoute(String(card.cardID))without a wallet-specific flag and watchingprivatePersonalDetailswith a ref: Rejected becauseMissingPersonalDetailsContentwould executeSET_PERSONAL_DETAILS_AND_REVEAL_CARD_DETAILS(revealing card credentials) for virtual UK/EU cards orSET_PIN_ORDER_CARDfor physical UK/EU cards, and an unguarded ref watchingprivatePersonalDetailscompleteness would remain armed after cancellation.
Contributor details Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~013fb1bb5214e64795
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
@MelvinBot Update your proposal as information about code changes as well.
Proposal
Updated with the specific code changes.
What is the root cause of that problem?
The native UK/EU Add to Wallet handler starts wallet authentication without checking required private personal details.
The existing collection flow cannot be reused unchanged: its completion branches reveal virtual-card credentials or order physical cards instead of continuing wallet enrollment.
Code evidence
AddToWalletButton/index.native.tsx:28–38: immediate wallet authentication.MissingPersonalDetailsContent.tsx:68–155: PIN, ordering and reveal branches.
What changes do you think we should make in order to solve the problem?
-
Gate wallet enrollment. Update
AddToWalletButton/index.native.tsx:28–38to read private personal details and reuseareAddressAndPersonalDetailsMissing, matching reveal’s requirements. Complete details proceed directly; missing details open collection with a wallet purpose and unique attempt ID. Preserve non-UK/EU behavior. -
Carry the wallet purpose through navigation. Extend the collection and verification routes in
ROUTES.ts:375–406and theirnavigation types:1629–1638. Forward the purpose and attempt ID through collection, editing and verification. Existing callers retain their current behavior. -
Add a wallet-specific collection branch. In
MissingPersonalDetailsContent.tsx:68–155, skip PIN collection and bypass ordering/reveal actions for wallet enrollment. InMissingPersonalDetailsValidateCodePage.tsx:74–141, use theUPDATE_PERSONAL_DETAILSverification reason and save-only action. -
Confirm the save from its actual response. Reuse the payload construction in
PersonalDetails.ts:542–591, adding a wallet-only helper usingmakeRequestWithSideEffectsand its command/type mapping. Require an explicit successful response; leave Profile’s queued save unchanged. -
Resume once, with cancellation protection. Add a small in-memory attempt store holding the original card enrollment payload. Only the matching successful save can consume that attempt. Dismiss collection, then start the existing wallet scenario after the transition. Actual cancellation, dismissal, superseding attempts or owner teardown invalidate it; late responses cannot restart enrollment.
Why use a response-returning save?
Queued success data alone is insufficient: SequentialQueue.ts:540–553 also applies it for AlreadyCreated. The existing WiseOnboarding.ts:64–85 demonstrates using queued and response-returning dispatch for the same command in different flows. No queue-wide change is proposed.
Regression tests
- Missing details prompt before authentication; complete details proceed directly.
- Successful save resumes the correct card exactly once.
- Failed/incorrect-code saves, offline operation, cancellation and stale responses never start enrollment.
- Wallet collection never requests a PIN, orders a card or reveals credentials.
- Existing reveal, shipping and non-UK/EU behavior remains unchanged.
What alternative solutions did you explore? (Optional)
Watching shared profile completeness or loading state does not prove this attempt saved successfully. Reusing collection unchanged also causes unrelated reveal/order operations.
Source-verified proposal only; no code changes or runtime verification performed.
Next Steps for Contributor+ team:
To accept: @MelvinBot implement [this](https://github.com/Expensify/App/issues/106008#issuecomment-6875085275) to create a draft PR.
To refine: @MelvinBot <your feedback>
To reject: Explain why you are rejecting Melvin’s proposal.
Current assignee @chuckdries is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.
Implementation partially completed; no PR created. This run reached its execution limit.
Changes are uncommitted on claude-walletPersonalDetails:
- Added the missing-details check before UK/EU wallet enrollment.
- Added save-only collection with single-use, cancelable enrollment continuation.
- Added regression tests and addressed review findings around modal dismissal and canceled attempts.
Validation: Targeted tests and type checking passed during development, but the latest adjustments still need rechecking. The React Compiler check was blocked by an invalid origin/ base reference.
Remaining: Finish lint/formatting checks, rerun tests and type checking, complete web verification and final review, then commit, push, and create the draft PR. Native enrollment remains runtime-unverified.
@chuckdries, @parasharrajat Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!