Skip to content

[READY FOR PAYMENT] [$500] Expensify Card - Magic code error does not appear above Verify button when revealing details #73134

Closed

Description

@lanitochka17

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 9.2.35-0
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: #72018
Email or phone of affected tester (no customers): #72018
Issue reported by: Applause - Internal Team

Action Performed:

Precondition:

  • User has assigned themselves a virtual card
  1. Go to staging.new.expensify.com
  2. Go to Account > Wallet
  3. Click on the virtual card
  4. Click Reveal details
  5. Enter wrong magic code
  6. Click RHP back button

Expected Result:

In Step 5, magic code error will appear above Verify button

Actual Result:

In Step 5, magic code error does not appear above Verify button
In Step 6, magic code error appears on the previous page, under Reveal details button

Workaround:

Unknown

Platforms:

Select the officially supported platforms where the issue was reproduced:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari
  • MacOS: Desktop
Platforms Tested: On which of our officially supported platforms was this issue tested:
  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence
Bug6980750_1761064131433.Screen_Recording_2025-10-22_at_00.25.40.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021981780679028973300
  • Upwork Job ID: 1981780679028973300
  • Last Price Increase: 2025-11-03
Issue OwnerCurrent Issue Owner: @ryntgh

Activity

  1. added
    Daily
    Bug
    on Oct 21, 2025
  2. melvin-bot commented on Oct 21, 2025

    @melvin-bot

    Triggered auto assignment to @abekkala (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

  3. ryntgh commented on Oct 22, 2025

    @ryntgh
    Contributor

    Proposal

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

    Expensify Card - Magic code error does not appear above Verify button when revealing details

    What is the root cause of that problem?

    Currently we use validateCodeActionErrorField = "actionVerified", but when an incorrect magic code is entered during card reveal, the actual error field set by the backend is revealExpensifyCardDetails

    However, if we change validateCodeActionErrorField to revealExpensifyCardDetails, the clearError function only clears the local state (setValidateError({})) and does not clear the Onyx error fields. This causes rate limiting errors like Failed to send a new magic code. Please wait a bit and try again. to remain visible and not be dismissed when clicking the 'X' button, because the error is stored in the VALIDATE_ACTION_CODE Onyx key

    return (
    <ValidateCodeActionContent
    title={translate('cardPage.validateCardTitle')}
    descriptionPrimary={translate('cardPage.enterMagicCode', {contactMethod: primaryLogin})}
    sendValidateCode={() => requestValidateCodeAction()}
    validateCodeActionErrorField="actionVerified"
    handleSubmitForm={handleRevealCardDetails}
    validateError={validateError}
    clearError={() => setValidateError({})}
    onClose={() => {
    resetValidateActionCodeSent();
    Navigation.goBack(ROUTES.SETTINGS_WALLET_DOMAIN_CARD.getRoute(cardID));
    }}
    />

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

    We need to handle both local and Onyx error clearing with clearValidateCodeActionError to ensure that rate limiting errors like Failed to send a new magic code. Please wait a bit and try again. can be dismissed, and that incorrect magic code errors like Looks like the magic code you entered was incorrect. Please try again. are displayed correctly above the Verify button

        const [validateCodeAction] = useOnyx(ONYXKEYS.VALIDATE_ACTION_CODE, {canBeMissing: true});
    
        const clearError = () => {
            if (isEmptyObject(validateError) && isEmptyObject(validateCodeAction?.errorFields)) {
                return;
            }
            setValidateError({});
            clearValidateCodeActionError('actionVerified');
        };
            <ValidateCodeActionContent
                title={translate('cardPage.validateCardTitle')}
                descriptionPrimary={translate('cardPage.enterMagicCode', {contactMethod: primaryLogin})}
                sendValidateCode={() => requestValidateCodeAction()}
                validateCodeActionErrorField="revealExpensifyCardDetails"
                handleSubmitForm={handleRevealCardDetails}
                validateError={validateError}
                clearError={clearError}
                onClose={() => {
                    resetValidateActionCodeSent();
                    Navigation.goBack(ROUTES.SETTINGS_WALLET_DOMAIN_CARD.getRoute(cardID));
                }}
            />

    <ValidateCodeActionContent
    title={translate('cardPage.validateCardTitle')}
    descriptionPrimary={translate('cardPage.enterMagicCode', {contactMethod: primaryLogin})}
    sendValidateCode={() => requestValidateCodeAction()}
    validateCodeActionErrorField="actionVerified"
    handleSubmitForm={handleRevealCardDetails}
    validateError={validateError}
    clearError={() => setValidateError({})}
    onClose={() => {
    resetValidateActionCodeSent();
    Navigation.goBack(ROUTES.SETTINGS_WALLET_DOMAIN_CARD.getRoute(cardID));
    }}
    />

    What alternative solutions did you explore? (Optional)

    We can make the onClose handler on BaseValidateCodeForm to also clear the actionVerified error field when dismissing errors

                        clearError();
                        if (!isEmptyObject(validateCodeAction?.errorFields) && validateCodeActionErrorField) {
                            clearValidateCodeActionError(validateCodeActionErrorField);
                        }
                        if (!isEmptyObject(validateCodeAction?.errorFields?.actionVerified)) {
                            clearValidateCodeActionError('actionVerified');
                        }

    clearError();
    if (!isEmptyObject(validateCodeAction?.errorFields) && validateCodeActionErrorField) {
    clearValidateCodeActionError(validateCodeActionErrorField);
    }

    and set validateCodeActionErrorField to revealExpensifyCardDetails on ExpensifyCardVerifyAccountPage

  4. added
    External
    on Oct 24, 2025
  5. changed the title [-]Expensify Card - Magic code error does not appear above Verify button when revealing details[/-] [+][$250] Expensify Card - Magic code error does not appear above Verify button when revealing details[/+] on Oct 24, 2025
  6. melvin-bot commented on Oct 24, 2025

    @melvin-bot
  7. added
    Help Wanted
    on Oct 24, 2025
  8. melvin-bot commented on Oct 24, 2025

    @melvin-bot

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

  9. bernhardoj commented on Oct 25, 2025

    @bernhardoj
    Contributor

    Since actionVerified error is being used inside BaseValidateCodeForm as a fallback, it makes sense to clear the error when dismissing it inside BaseValidateCodeForm too, so it's fixed globally.

    const defaultValidateCodeError = getLatestErrorField(validateCodeAction, 'actionVerified');

    So, @ryntgh's alternative solution looks good

    🎀 👀 🎀 C+ reviewed

  10. melvin-bot commented on Oct 25, 2025

    @melvin-bot

    Triggered auto assignment to @danieldoglas, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

  11. 17 remaining items

  12. ryntgh commented on Nov 20, 2025

    @ryntgh
    Contributor

    The 2nd PR is ready for review @bernhardoj

  13. added and removed
    Weekly
    on Dec 16, 2025
  14. melvin-bot commented on Dec 16, 2025

    @melvin-bot

    This issue has not been updated in over 15 days. @danieldoglas, @abekkala, @bernhardoj, @ryntgh eroding to Monthly issue.

    P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

  15. bernhardoj commented on Dec 16, 2025

    @bernhardoj
    Contributor

    @abekkala looks like the automation failed. This should be ready for payment on 18 dec

  16. abekkala commented on Dec 16, 2025

    @abekkala
    Contributor

    PAYMENT SUMMARY

    • Fix: @ryntgh [$500] payment via Upwork - OFFER
    • PR Review: @bernhardoj [$500] payment via NewDot
      Can you complete the checklist for this one?

    The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it.

  17. changed the title [-][$500] Expensify Card - Magic code error does not appear above Verify button when revealing details[/-] [+][READY FOR PAYMENT] [$500] Expensify Card - Magic code error does not appear above Verify button when revealing details[/+] on Dec 16, 2025
  18. ryntgh commented on Dec 16, 2025

    @ryntgh
    Contributor

    Thanks! I've accepted the offer

  19. bernhardoj commented on Dec 16, 2025

    @bernhardoj
    Contributor

    BugZero Checklist:

    • [Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.

      Link to comment: https://github.com/Expensify/App/pull/72018/files#r2623583501

    • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.

      Link to discussion: N/A

    • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

    Regression Test Proposal Template

    Regression Test Proposal

    Precondition:

    • User has assigned themselves a virtual card

    Test:

    1. Go to Account > Wallet
    2. Press on the virtual card
    3. Press Reveal details
    4. Enter the wrong magic code
    5. Verify an invalid magic code error is shown above the submit button

    Do we agree 👍 or 👎

  20. bernhardoj commented on Dec 16, 2025

    @bernhardoj
    Contributor

    Requested in ND.

  21. abekkala commented on Dec 16, 2025

    @abekkala
    Contributor

    @ryntgh payment sent via Upwork and contract ended - thank you! 🎉

  22. abekkala commented on Dec 16, 2025

    @abekkala
    Contributor

    Posting payment summary once more for easier visibility:

    • Fix: @ryntgh [$500] payment sent via Upwork
    • PR Review: @bernhardoj [$500] payment will be sent via NewDot

    Thanks! 🎉

  23. garrettmknight commented on Dec 18, 2025

    @garrettmknight
    Contributor

    $500 approved for @bernhardoj

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

Metadata

Metadata

Labels

BugExternalMonthlyReviewing

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions