Skip to content

[Due for payment 2025-05-20] [$150] Expensify Card - Limit input page shows error after incorrect magic code is entered #61051

Closed

Description

@mitarachim

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.1.33-3
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: No, reproducible on hybrid only
If this was caught during regression testing, add the test name, ID and link from TestRail: Exp
Email or phone of affected tester (no customers): applausetester+khcategory19@applause.expensifail.com
Issue reported by: Applause Internal Team
Device used: Mac 15.3 / Chrome
App Component: Workspace Settings

Action Performed:

Precondition:

  • Workspace has enabled Expensify Card feature and has set up bank account.
  1. Go to staging.new.expensify.com
  2. Go to workspace settings > Expensify Card.
  3. Click Issue card.
  4. Fill in the details and reach the confirmation page.
  5. On confirmation page, enter incorrect magic code.
  6. Now enter the correct magic code.
  7. Click Issue card.
  8. Select any member.
  9. Select any card type > Next.
  10. Select Limit type > Next.

Expected Result:

Limit input page will not show error.

Actual Result:

Limit input page shows error - You must be a domain admin to create the virtual card.

Workaround:

Unknown

Platforms:

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6816046_1745907880813.20250429_141825.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021917579859517676775
  • Upwork Job ID: 1917579859517676775
  • Last Price Increase: 2025-05-01
  • Automatic offers:
    • mkzie2 | Contributor | 107140179
Issue OwnerCurrent Issue Owner: @
Issue OwnerCurrent Issue Owner: @joekaufmanexpensify

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Apr 29, 2025
  2. melvin-bot commented on Apr 29, 2025

    @melvin-bot

    Triggered auto assignment to @joekaufmanexpensify (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. mkzie2 commented on Apr 29, 2025

    @mkzie2
    Contributor

    🚨 Edited by proposal-police: This proposal was edited at 2025-05-01 16:28:53 UTC.

    Proposal

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

    Limit input page shows error - You must be a domain admin to create the virtual card.

    What is the root cause of that problem?

    We already have logics to clear error here

    clearError={() => clearIssueNewCardError(policyID)}

    function clearIssueNewCardError(policyID: string | undefined) {
    Onyx.merge(`${ONYXKEYS.COLLECTION.ISSUE_NEW_EXPENSIFY_CARD}${policyID}`, {errors: null});
    }

    However, when validating with incorrect magic code, We don’t send policyID together with CreateAdminIssuedVirtualCard, so BE send error in issueNewExpensifyCard with no policyID

    Image

    So we're not clearing the correct Onyx entry and the error persists.

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

    1. BE should return error in correct Onyx entry
    2. To fix this in FE, create a new Onyx key for issueNewExpensifyCard, then we should update clearIssueNewCardError to clear error in issueNewExpensifyCard as well

    function clearIssueNewCardError(policyID: string | undefined) {
    Onyx.merge(`${ONYXKEYS.COLLECTION.ISSUE_NEW_EXPENSIFY_CARD}${policyID}`, {errors: null});
    }

    function clearIssueNewCardError(policyID: string | undefined) {
        Onyx.merge(`${ONYXKEYS.COLLECTION.ISSUE_NEW_EXPENSIFY_CARD}${policyID}`, {errors: null});
        Onyx.merge(‘issueNewExpensifyCard’, {errors: null});
    }

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    I don't think we need one, because it's error when sending API.

    What alternative solutions did you explore? (Optional)

    We should pass policyID to CreateAdminIssuedVirtualCard parameters

    const parameters = {
    assigneeEmail,
    limit,
    limitType,
    cardTitle,
    validateCode,
    domainAccountID,
    };

    Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

  4. joekaufmanexpensify commented on Apr 30, 2025

    @joekaufmanexpensify
    Contributor

    Reproduced. The error clears if you proceed past it, so it's no major impact. But it's confusing so feels worth cleaning it up.

  5. melvin-bot commented on Apr 30, 2025

    @melvin-bot
  6. changed the title [-]Expensify Card - Limit input page shows error after incorrect magic code is entered[/-] [+][$250] Expensify Card - Limit input page shows error after incorrect magic code is entered[/+] on Apr 30, 2025
  7. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Apr 30, 2025
  8. melvin-bot commented on Apr 30, 2025

    @melvin-bot

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

  9. 28 remaining items

  10. melvin-bot commented on May 13, 2025

    @melvin-bot

    Reviewing label has been removed, please complete the "BugZero Checklist".

  11. melvin-bot commented on May 13, 2025

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.44-8 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

    If no regressions arise, payment will be issued on 2025-05-20. 🎊

    For reference, here are some details about the assignees on this issue:

  12. melvin-bot commented on May 13, 2025

    @melvin-bot

    @dukenv0307 @joekaufmanexpensify @dukenv0307 The PR fixing this issue has been merged! 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. If you have the K2 extension, you can simply click: [this button]

  13. dukenv0307 commented on May 14, 2025

    @dukenv0307
    Contributor

    BugZero Checklist:

    • [Contributor] Classify the bug:
    Bug classification

    Source of bug:

    • 1a. Result of the original design (eg. a case wasn't considered)
    • 1b. Mistake during implementation
    • 1c. Backend bug
    • 1z. Other:

    Where bug was reported:

    • 2a. Reported on production
    • 2b. Reported on staging (deploy blocker)
    • 2c. Reported on a PR
    • 2z. Other:

    Who reported the bug:

    • 3a. Expensify user
    • 3b. Expensify employee
    • 3c. Contributor
    • 3d. QA
    • 3z. Other:
    • [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/59996/files#r2089426301

    • [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. Yes

    Regression Test Proposal Template
    • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

      Link to issue:

    Regression Test Proposal

    Test:

    • Precondition: Workspace has enabled Expensify Card feature and has set up bank account.
    1. Go to workspace settings > Expensify Card.
    2. Click Issue card.
    3. Select Virtual card type
    4. Fill in the details and reach the confirmation page.
    5. On confirmation page, enter incorrect magic code.
    6. Now enter the correct magic code.
    7. Click Issue card.
    8. Select any member.
    9. Select Virtual card type > Next.
    10. Select Limit type > Next.
    11. Verify that: Limit input page will not show error.

    Do we agree 👍 or 👎

  14. joekaufmanexpensify commented on May 19, 2025

    @joekaufmanexpensify
    Contributor

    Will handle next steps today so we're prepped to pay tomorrow

  15. joekaufmanexpensify commented on May 19, 2025

    @joekaufmanexpensify
    Contributor

    This is a pretty niche bug. Only applicable if you're issuing multiple cards in short succession and incorrectly enter magic code when issuing the first one. I don't think we need to have QA test this flow in every test run as it is not likely to be something commonly done by actual users. Going to skip the test for now.

  16. joekaufmanexpensify commented on May 19, 2025

    @joekaufmanexpensify
    Contributor

    All set to pay tomorrow! We need to pay:

  17. joekaufmanexpensify commented on May 20, 2025

    @joekaufmanexpensify
    Contributor

    @mkzie2 $150 sent and contract ended!

  18. joekaufmanexpensify commented on May 20, 2025

    @joekaufmanexpensify
    Contributor

    Upwork job closed.

  19. joekaufmanexpensify commented on May 20, 2025

    @joekaufmanexpensify
    Contributor

    @dukenv0307 Please request payment at your earliest convenience. Closing as this is otherwise all set!

  20. JmillsExpensify commented on May 22, 2025

    @JmillsExpensify
    Contributor

    $150 approved for @dukenv0307

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

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions