Skip to content

[BUG] Reveal CVV details doesn't reveal it #85401

Closed

Description

@rlinoz

Having Central Travel Invoicing enabled

  1. Go to Profile > Wallet
  2. Travel CVV
  3. Reveal details and input the magic code

Expected result
CVV is displayed

Actual results
CVV is not displayed

Screen.Recording.2026-03-16.at.09.40.53.mov
Issue OwnerCurrent Issue Owner: @Krishna2323
Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~022033528002037544860
  • Upwork Job ID: 2033528002037544860
  • Last Price Increase: 2026-03-16

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Mar 16, 2026
  2. MelvinBot commented on Mar 16, 2026

    @MelvinBot
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    When a user with Central Travel Invoicing enabled goes to Profile > Wallet > Travel CVV and taps "Reveal details", then enters the magic code, the CVV is not displayed. It should show the actual CVV value after successful verification.

    What is the root cause of that problem?

    The Travel CVV reveal flow reuses the RevealExpensifyCardDetails backend API command (via revealVirtualCardDetails in src/libs/actions/Card.ts:583-646), which was designed for regular Expensify virtual cards. The API response is unsafely cast as ExpensifyCardDetails (response as ExpensifyCardDetails at Card.ts:641) which expects {pan, expiration, cvv}.

    For travel invoicing cards (feedCountry=TRAVEL_US), the backend likely does not return the cvv field in the response (or returns it differently), since these are a different card type. When this happens, cardDetails.cvv is undefined, and the code at TravelCVVVerifyAccountPage.tsx:46:

    setCvv(cardDetails.cvv ?? null);
    

    evaluates to setCvv(null). The page then navigates back to TravelCVVPage, which displays '•••' because cvv is still null (line 98: title={cvv ?? '•••'}), and the "Reveal details" button remains visible (line 105: !cvv).

    This bug is masked in development/staging because getTravelInvoicingCard() in src/libs/TravelInvoicingUtils.ts:181-182 has a fallback that uses a regular Expensify card when isTravelCVVTestingEnabled() is true and no actual travel card exists. Regular Expensify cards do return cvv from the API, so the flow works in testing.

    There is also a secondary issue: if travelCard?.cardID is falsy when the verify page renders (e.g., the card list hasn't loaded), handleRevealCardDetails at TravelCVVVerifyAccountPage.tsx:35-37 silently returns without making the API call or showing any error.

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

    1. Backend fix (primary): The RevealExpensifyCardDetails backend command needs to support travel invoicing cards and return the cvv field in the response for cards with feedCountry=TRAVEL_US. This is the core fix.

    2. Client-side resilience in TravelCVVVerifyAccountPage.tsx:

      • After the API succeeds, check if cardDetails.cvv is actually present before navigating back. If it's missing, show an error to the user instead of silently setting null and navigating back.
      • When travelCard?.cardID is falsy (line 35-37), show an error instead of silently returning.
    3. Client-side resilience in Card.ts:

      • After the API returns success (jsonCode === SUCCESS), validate that the expected fields (cvv at minimum for the travel flow) are present before resolving. If cvv is missing from the response, reject with an appropriate error message.

    What alternative solutions did you explore? (Optional)

    • Creating a separate API command for travel cards: Rather than extending RevealExpensifyCardDetails, a dedicated RevealTravelCardCVV command could be created. This would avoid modifying the existing command's behavior but would add maintenance overhead. Extending the existing command is simpler if the backend can distinguish card types.

    • Storing the full response (pan + expiration + cvv) like ExpensifyCardPage: The regular card flow stores all details in context. However, the current approach of only storing CVV is correct for the travel flow since PAN/expiration aren't displayed. The issue is purely that the backend isn't returning CVV for these card types.


    Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot <your feedback> to refine this analysis, or explain why you are rejecting Melvin's proposal.

  3. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Mar 16, 2026
  4. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Mar 16, 2026
  5. melvin-bot commented on Mar 16, 2026

    @melvin-bot

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

  6. changed the title [-][BUG] Reveal CVV details doesn't reveal it[/-] [+][$250] [BUG] Reveal CVV details doesn't reveal it[/+] on Mar 16, 2026
  7. melvin-bot commented on Mar 16, 2026

    @melvin-bot
  8. added
    InternalRequires API changes or must be handled by Expensify staff
    and removed
    ExternalAdded to denote the issue can be worked on by a contributor
    Help WantedApply this label when an issue is open to proposals by contributors
    on Mar 16, 2026
  9. changed the title [-][$250] [BUG] Reveal CVV details doesn't reveal it[/-] [+][BUG] Reveal CVV details doesn't reveal it[/+] on Mar 16, 2026
  10. JasimMalook commented on Mar 16, 2026

    @JasimMalook

    Hi, I would like to work on this issue.

    Initial Analysis:
    Based on the reproduction steps, the CVV should be revealed after the user clicks “Reveal details” and enters the magic code, but it remains hidden. This suggests that the UI state responsible for toggling the CVV visibility may not be updating correctly after successful verification.

    Proposed Fix:

    1. Identify the component responsible for rendering the Travel CVV field in the Wallet settings screen.
    2. Review the logic that handles the “Reveal details” action and the magic code verification flow.
    3. Ensure that once the verification succeeds, the state controlling the CVV visibility (e.g., reveal flag) is correctly updated.
    4. Update the conditional rendering logic so the component switches from the masked value to the actual CVV.
    5. Verify that the API response containing the CVV is properly passed and stored in the component state.
    6. Test the fix across supported platforms to confirm the reveal functionality works consistently.

    I will also ensure that the change does not introduce regressions to other sensitive fields that rely on masking logic.

  11. melvin-bot commented on Mar 16, 2026

    @melvin-bot

    📣 @JasimMalook! 📣
    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>
    
  12. JasimMalook commented on Mar 16, 2026

    @JasimMalook

    Contributor details
    Your Expensify account email: jasimmalook@gmail.com
    Upwork Profile Link: https://www.upwork.com/freelancers/~014c25762fc2275193

  13. melvin-bot commented on Mar 16, 2026

    @melvin-bot

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

  14. blimpich commented on Mar 16, 2026

    @blimpich
    Contributor

    Sorry @JasimMalook this issue is not taking proposals right now. Please see our contributing guidelines on how to find issues to work on

  15. blimpich commented on Mar 18, 2026

    @blimpich
    Contributor

    I tested this on latest staging and it works, closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.InternalRequires API changes or must be handled by Expensify staffReviewingHas a PR in reviewWeeklyKSv2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions