App icon indicating copy to clipboard operation
App copied to clipboard

[$175] Expensify Card - Prompt users to complete private personal details before wallet enrollment

Open chuckdries opened this issue 3 weeks ago • 36 comments

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

  1. Open the details page for a virtual Expensify Card and select Add to Wallet.
  2. If required private personal details are missing, show the existing personal-details collection flow.
  3. After the user completes and successfully saves the details, continue to wallet enrollment.
  4. 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
Issue OwnerCurrent Issue Owner: @parasharrajat

chuckdries avatar Nov 04 '26 21:11 chuckdries

@chuckdries Eep! 4 days overdue now. Issues have feelings too...

melvin-bot[bot] avatar Nov 09 '26 21:11 melvin-bot[bot]

Triggered auto assignment to Contributor-plus team member for initial proposal review - @parasharrajat (External)

melvin-bot[bot] avatar Nov 10 '26 17:11 melvin-bot[bot]

Job added to Upwork: https://www.upwork.com/jobs/~022120211810646931528

melvin-bot[bot] avatar Nov 10 '26 17:11 melvin-bot[bot]

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?

  1. Missing Precondition Check in AddToWalletButton: In src/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)
            ...
    };
    

    AddToWalletButton does not subscribe to or inspect ONYXKEYS.PRIVATE_PERSONAL_DETAILS. When handleOnPress is invoked for a UK/EU card (or native wallet enrollment), it immediately triggers executeScenario(CONST.MULTIFACTOR_AUTHENTICATION.SCENARIO.ADD_TO_DIGITAL_WALLET, ...) without validating whether the user's KYC / private personal details are populated.

  2. 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 in src/libs/PersonalDetailsUtils.ts#L503), which strictly checks:

    • legalFirstName
    • legalLastName
    • dob
    • phoneNumber
    • addresses[0] with street, city, zip, country, and state/province. If any of these fields are missing, it redirects to the dedicated collection RHP via DYNAMIC_ROUTES.MISSING_PERSONAL_DETAILS. AddToWalletButton currently lacks this verification step.

What changes do you think we should make in order to solve the problem?

  1. Update src/components/AddToWalletButton/index.native.tsx:

    • Subscribe to ONYXKEYS.PRIVATE_PERSONAL_DETAILS using useOnyx(ONYXKEYS.PRIVATE_PERSONAL_DETAILS).
    • Import areAddressAndPersonalDetailsMissing from @libs/PersonalDetailsUtils, createDynamicRoute from @libs/Navigation/helpers/dynamicRoutesUtils/createDynamicRoute, and DYNAMIC_ROUTES from @src/ROUTES.
    • Maintain an awaiting state ref (e.g. isAwaitingPersonalDetailsRef = useRef(false)) to detect when the user returns from saving details.
    • In handleOnPress: When isUkEuExpensifyCard(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.
      • If details are complete, proceed directly with executeScenario(CONST.MULTIFACTOR_AUTHENTICATION.SCENARIO.ADD_TO_DIGITAL_WALLET, {card, cardHolderName, cardDescription}).
    • Add a reactive useEffect on [privatePersonalDetails, card, cardHolderName, cardDescription, executeScenario]:
      • If isAwaitingPersonalDetailsRef.current is true and !areAddressAndPersonalDetailsMissing(privatePersonalDetails):
        • Reset isAwaitingPersonalDetailsRef.current = false.
        • Automatically trigger wallet enrollment: executeScenario(CONST.MULTIFACTOR_AUTHENTICATION.SCENARIO.ADD_TO_DIGITAL_WALLET, {card, cardHolderName, cardDescription}).
      • If the user cancels the collection flow or closes the RHP without saving, privatePersonalDetails remains incomplete, so isAwaitingPersonalDetailsRef.current stays guarded and enrollment does not start.
  2. Integration with MissingPersonalDetails:

    • When the user completes the flow in src/pages/MissingPersonalDetails/MissingPersonalDetailsContent.tsx, it executes SET_PERSONAL_DETAILS_AND_REVEAL_CARD_DETAILS, which calls setPersonalDetailsAndRevealExpensifyCardWithSCA to persist the details to the backend and merge them into Onyx PRIVATE_PERSONAL_DETAILS.
    • In src/components/MultifactorAuthentication/config/scenarios/SetPersonalDetailsAndRevealCardDetails.tsx#L85, the callback closes the RHP (Navigation.closeRHPFlow()) and returns to DYNAMIC_ROUTES.WALLET_DOMAIN_CARD.
    • Upon return to ExpensifyCardPage, the updated privatePersonalDetails in Onyx satisfies !areAddressAndPersonalDetailsMissing(privatePersonalDetails) and AddToWalletButton seamlessly launches the ADD_TO_DIGITAL_WALLET enrollment.
  3. Automated Unit Tests in tests/unit/components/AddToWalletButton.test.tsx:

    • Add test cases covering:
      1. Tapping Add to wallet for a UK/EU card when personal details are missing prompts the user by navigating to DYNAMIC_ROUTES.MISSING_PERSONAL_DETAILS and does NOT start ADD_TO_DIGITAL_WALLET.
      2. When personal details are successfully populated in Onyx following the prompt, ADD_TO_DIGITAL_WALLET starts automatically.
      3. Tapping Add to wallet when personal details are already complete proceeds directly to ADD_TO_DIGITAL_WALLET without navigation to missing details.
      4. Canceling or dismissing the collection flow leaves details incomplete and does not start enrollment.

What alternative solutions did you explore? (Optional)

  1. 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.
  2. 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_DETAILS provides a guided step-by-step wizard specifically built for cardholder KYC details.

— submitted with Antigravity on the contributor's behalf

HindsightWise avatar Nov 10 '26 21:11 HindsightWise

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

melvin-bot[bot] avatar Nov 10 '26 21:11 melvin-bot[bot]

@chuckdries Will you work on this?

parasharrajat avatar Nov 11 '26 15:11 parasharrajat

@parasharrajat I was hoping we could get melvin or an external contributor to implement it

chuckdries avatar Nov 11 '26 16:11 chuckdries

@MelvinBot Add a proposal for this issue.

parasharrajat avatar Nov 11 '26 17:11 parasharrajat

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

What changes do you think we should make in order to solve the problem?

  1. 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.

  2. 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.

  3. Use the existing save-only API. Reuse UpdatePrivatePersonalDetails and 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.

  4. 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_WALLET scenario.

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.


view run

MelvinBot avatar Nov 11 '26 17:11 MelvinBot

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?

  1. src/components/AddToWalletButton/index.native.tsx:34-38 immediately calls executeScenario(CONST.MULTIFACTOR_AUTHENTICATION.SCENARIO.ADD_TO_DIGITAL_WALLET, {card, cardHolderName, cardDescription}) whenever isUkEuExpensifyCard(card) is true, without checking whether required private personal details (firstName, lastName, legalFirstName, legalLastName, dob, address, phoneNumber) are already present in Onyx.
  2. Navigating directly to DYNAMIC_ROUTES.MISSING_PERSONAL_DETAILS.getRoute(String(card.cardID)) without an explicit wallet-enrollment intent is unsafe because MissingPersonalDetails is tightly coupled to card shipping and PAN/CVV reveal flows:
    • In src/pages/MissingPersonalDetails/MissingPersonalDetailsContent.tsx:76, const shouldCollectPIN = !!cardID && isUkEuExpensifyCard(targetCard) && !isVirtualCard; is true for physical UK/EU cards — forcing the user through PIN creation and triggering SET_PIN_ORDER_CARD (MissingPersonalDetailsContent.tsx:95-127) / SHIP_CARD (MissingPersonalDetailsValidateCodePage.tsx:98-126).
    • For virtual UK/EU cards (isVirtualCard && isUkEuExpensifyCard(targetCard)), MissingPersonalDetailsContent.tsx:95-127 and MissingPersonalDetailsValidateCodePage.tsx:98-126 execute SET_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_WALLET after details are saved.

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:

  1. 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.ts before calling executeScenario(CONST.MULTIFACTOR_AUTHENTICATION.SCENARIO.ADD_TO_DIGITAL_WALLET, ...).
    • If required private personal details are incomplete, navigate to MissingPersonalDetails with an explicit wallet-enrollment intent (e.g., query/route param or Onyx pending wallet-enrollment state tied to card.cardID) rather than launching the MFA wallet scenario prematurely.
  2. 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) to false even 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 of SET_PIN_ORDER_CARD, SHIP_CARD, SET_PERSONAL_DETAILS_AND_REVEAL_CARD_DETAILS, or REVEAL_CARD_DETAILS.
  3. Single-use resume into ADD_TO_DIGITAL_WALLET MFA 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 trigger executeScenario(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).
  4. Tests:
    • Add unit/navigation tests covering: (a) incomplete private personal details for physical & virtual UK/EU cards redirects to MissingPersonalDetails without PIN prompt or SHIP_CARD / REVEAL_CARD_DETAILS, (b) completing details saves PRIVATE_PERSONAL_DETAILS and resumes ADD_TO_DIGITAL_WALLET once, and (c) cancelling clears pending resume state.

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

almagas avatar Nov 13 '26 12:11 almagas

📣 @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:

  1. Make sure you've read and understood the contributing guidelines.
  2. 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.
  3. 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.
  4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details. Screen Shot 2022-11-16 at 4 42 54 PM Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

melvin-bot[bot] avatar Nov 13 '26 12:11 melvin-bot[bot]

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?

  1. No personal-details completeness check in src/components/AddToWalletButton/index.native.tsx:34-38:
    • When isUkEuExpensifyCard(card) is true, handleOnPress immediately calls executeScenario(CONST.MULTIFACTOR_AUTHENTICATION.SCENARIO.ADD_TO_DIGITAL_WALLET, {card, cardHolderName, cardDescription}) without checking areAddressAndPersonalDetailsMissing(privatePersonalDetails) (defined in src/libs/PersonalDetailsUtils.ts:503-514, which is used by the virtual card reveal flow in src/pages/settings/Wallet/ExpensifyCardPage/index.tsx:549-552 to require legalFirstName, legalLastName, dob, phoneNumber, and addresses[0] with street, city, zip, country, and state for US addresses).
  2. MissingPersonalDetails cannot be navigated to with only cardID unchanged (src/pages/MissingPersonalDetails/MissingPersonalDetailsContent.tsx & MissingPersonalDetailsValidateCodePage.tsx):
    • MissingPersonalDetailsContent.tsx:74-123 branches exclusively on cardID, isVirtualCard, and isUkEuExpensifyCard(targetCard):
      • For physical UK/EU cards (!isVirtualCard && isUkEuExpensifyCard(targetCard)), line 76 sets shouldCollectPIN = true and line 105 executes SET_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)), line 115 executes SET_PERSONAL_DETAILS_AND_REVEAL_CARD_DETAILS, which reveals sensitive PAN/CVV card credentials instead of only saving personal details.
    • Similarly, MissingPersonalDetailsValidateCodePage.tsx:98-121 branches only on isVirtualCard: calling setPersonalDetailsAndRevealExpensifyCard (with VALIDATE_CODE_REASONS.REVEAL_CARD_DETAILS) for virtual cards or updatePersonalDetailsAndShipExpensifyCards (with VALIDATE_CODE_REASONS.SHIP_CARD) for physical cards, rather than calling the save-only updatePrivatePersonalDetails action (WRITE_COMMANDS.UPDATE_PRIVATE_PERSONAL_DETAILS with COMMON_CONST.VALIDATE_CODE_REASONS.UPDATE_PERSONAL_DETAILS).
  3. Why an unguarded useEffect watching areAddressAndPersonalDetailsMissing(privatePersonalDetails) in AddToWalletButton is 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 useRef watcher in AddToWalletButton can unexpectedly launch wallet enrollment later when unrelated profile edits occur.

What changes do we think we should make in order to solve the problem?

  1. Add an explicit wallet-enrollment mode to DYNAMIC_ROUTES.MISSING_PERSONAL_DETAILS and DYNAMIC_ROUTES.MISSING_PERSONAL_DETAILS_CONFIRM_VALIDATE_CODE (src/ROUTES.ts, src/libs/Navigation/types.ts, src/pages/MissingPersonalDetails/index.tsx):

    • Allow MISSING_PERSONAL_DETAILS and MISSING_PERSONAL_DETAILS_CONFIRM_VALIDATE_CODE to accept an optional query/route parameter (or isForDigitalWallet?: boolean / purpose?: 'wallet' on MissingPersonalDetailsParamList) so the flow knows it was launched from Add to Wallet for cardID rather than card reveal or physical card shipping.
    • Forward isForDigitalWallet from MissingPersonalDetails/index.tsx into MissingPersonalDetailsContent and into DYNAMIC_ROUTES.MISSING_PERSONAL_DETAILS_CONFIRM_VALIDATE_CODE.getRoute(cardID, isForDigitalWallet).
  2. Use the save-only updatePrivatePersonalDetails flow when isForDigitalWallet is 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 (lines 91-123), when isForDigitalWallet is true, bypass both SET_PIN_ORDER_CARD and SET_PERSONAL_DETAILS_AND_REVEAL_CARD_DETAILS and call onComplete() directly to advance to MissingPersonalDetailsValidateCodePage.
    • In MissingPersonalDetailsValidateCodePage.tsx:
      • When isForDigitalWallet is true:
        • Use {reasonCode: COMMON_CONST.VALIDATE_CODE_REASONS.UPDATE_PERSONAL_DETAILS} for sendValidateCode and pass validateCodeReasonCode={COMMON_CONST.VALIDATE_CODE_REASONS.UPDATE_PERSONAL_DETAILS} and validateCodeActionErrorField="personalDetails" to ValidateCodeActionContent (matching PrivatePersonalDetailsConfirmValidateCodePage.tsx:74-78).
        • In handleSubmitForm(validateCode), call updatePrivatePersonalDetails(values, validateCode, countryCode) (src/libs/actions/PersonalDetails.ts:542).
        • Track the in-flight save with a wasSavingForWalletRef watching privatePersonalDetails?.isLoading transitioning from true -> false with !hasErrors and !areAddressAndPersonalDetailsMissing(privatePersonalDetails) ( matching PrivatePersonalDetailsConfirmValidateCodePage.tsx:46-58). When the save succeeds on the server, record the completed wallet-ready cardID (via a single-use callback/store or Onyx RAM-only state), call clearDraftValues(ONYXKEYS.FORMS.PERSONAL_DETAILS_FORM), and close the RHP (Navigation.closeRHPFlow()).
  3. Gate AddToWalletButton on areAddressAndPersonalDetailsMissing and 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 and areAddressAndPersonalDetailsMissing(privatePersonalDetails) is true:
        • Register a pending single-use wallet enrollment intent bound to card.cardID (cleared automatically if the user dismisses/cancels the MissingPersonalDetails RHP without completing the save) and navigate to createDynamicRoute(DYNAMIC_ROUTES.MISSING_PERSONAL_DETAILS.getRoute(String(card.cardID), undefined, undefined, true)).
        • Return early without starting ADD_TO_DIGITAL_WALLET.
      • When details are already complete (!areAddressAndPersonalDetailsMissing(privatePersonalDetails)), immediately call executeScenario(CONST.MULTIFACTOR_AUTHENTICATION.SCENARIO.ADD_TO_DIGITAL_WALLET, {card, cardHolderName, cardDescription}).
    • When MissingPersonalDetailsValidateCodePage finishes saving UpdatePrivatePersonalDetails for card.cardID and closes the RHP, consume the single-use completion token for card.cardID once and invoke executeScenario(CONST.MULTIFACTOR_AUTHENTICATION.SCENARIO.ADD_TO_DIGITAL_WALLET, {card, cardHolderName, cardDescription}).

What alternative solutions did you explore? (Optional)

  • Navigating to DYNAMIC_ROUTES.MISSING_PERSONAL_DETAILS.getRoute(String(card.cardID)) without a wallet-specific flag and watching privatePersonalDetails with a ref: Rejected because MissingPersonalDetailsContent would execute SET_PERSONAL_DETAILS_AND_REVEAL_CARD_DETAILS (revealing card credentials) for virtual UK/EU cards or SET_PIN_ORDER_CARD for physical UK/EU cards, and an unguarded ref watching privatePersonalDetails completeness would remain armed after cancellation.

cocvn157 avatar Nov 13 '26 13:11 cocvn157

Contributor details Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~013fb1bb5214e64795

almagas avatar Nov 13 '26 14:11 almagas

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

melvin-bot[bot] avatar Nov 13 '26 14:11 melvin-bot[bot]

@MelvinBot Update your proposal as information about code changes as well.

parasharrajat avatar Nov 14 '26 09:11 parasharrajat

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

What changes do you think we should make in order to solve the problem?

  1. Gate wallet enrollment. Update AddToWalletButton/index.native.tsx:28–38 to read private personal details and reuse areAddressAndPersonalDetailsMissing, 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.

  2. Carry the wallet purpose through navigation. Extend the collection and verification routes in ROUTES.ts:375–406 and their navigation types:1629–1638. Forward the purpose and attempt ID through collection, editing and verification. Existing callers retain their current behavior.

  3. Add a wallet-specific collection branch. In MissingPersonalDetailsContent.tsx:68–155, skip PIN collection and bypass ordering/reveal actions for wallet enrollment. In MissingPersonalDetailsValidateCodePage.tsx:74–141, use the UPDATE_PERSONAL_DETAILS verification reason and save-only action.

  4. Confirm the save from its actual response. Reuse the payload construction in PersonalDetails.ts:542–591, adding a wallet-only helper using makeRequestWithSideEffects and its command/type mapping. Require an explicit successful response; leave Profile’s queued save unchanged.

  5. 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.


view run

MelvinBot avatar Nov 14 '26 09:11 MelvinBot

@MelvinBot implement this

:ribbon: :eyes: :ribbon: C+ reviewed

parasharrajat avatar Nov 14 '26 11:11 parasharrajat

Current assignee @chuckdries is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.

melvin-bot[bot] avatar Nov 14 '26 11:11 melvin-bot[bot]

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.


view run

MelvinBot avatar Nov 14 '26 11:11 MelvinBot

@chuckdries, @parasharrajat Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!