Skip to content

[Due for payment 2025-10-01] [$250] Reports - App crashes after removing direct feed with assigned card transactions #70525

Closed

Description

@m-natarajan

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.13-1
Reproducible in staging?: Needs Reproduction
Reproducible in production?: Needs Reproduction
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: @ikevin127
Slack conversation (hyperlinked to channel name): #Expensify Bugs

Action Performed:

  1. Login with a new account, create a workspace and go to workspace settings > Company cards.
  2. Click Add cards and proceed to add a Direct feed card by either using a real card from one of the bank options or click Other to add a faux BA via Plaid flow (only on staging server).
  3. Once BA flow is completed, on the Statement close date RHP click Submit to complete BA addition.
  4. On the Company cards page, click [+] Assign card and assign card to yourself > on Choose a transaction start date step keep default (From the beginning) > click Assign card.
  5. Navigate to Reports page, click Expenses and verify that you see multiple expenses originating from the company card assigned in the previous step.
  6. Navigate to workspace settings > Company cards and click Settings > Remove card feed and confirm Delete.
  7. Navigate to Reports page.

Expected Result:

The app should not crash.

Actual Result:

The app crashes.

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
Screen.Recording.2025-09-12.at.17.28.28.mov

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021967598674017384654
  • Upwork Job ID: 1967598674017384654
  • Last Price Increase: 2025-09-22
Issue OwnerCurrent Issue Owner: @twisterdotcom

Activity

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

    @melvin-bot

    Triggered auto assignment to @twisterdotcom (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. m-natarajan commented on Sep 13, 2025

    @m-natarajan
    Author

    Proposal by @ikevin127

    Proposal

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

    App crashes on Reports page after removing direct feed with assigned card transactions.

    What is the root cause of that problem?

    The crash is coming from the getBankName function and it happens because we're missing optional chaining on the feedType value which is missing / undefined upon removing direct card feed with assigned card transactions.

    Here's a detailed chain of events leading to the crash:

    • user navigates to Reports page after removing direct feed with assigned card transactions
    • Reports page still renders the card transactions from the removed feed (stale data)
    • the rendered card transaction row renders the EReceipt.tsx component
    • the EReceipt.tsx component calls getCardDescription on this line
    • the getCardDescription function calls the getBankName function
    • the feedType value is missing / undefined because the card feed was removed
    • the app crashes because the two lines (line 1 and line 2) are missing optional chaining for the feedType value

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

    Add optional chaining for the feedType value on both lines (line 1 and line 2):

        // In existing OldDot setups other variations of feeds could exist, ex: vcf2, vcf3, oauth.americanexpressfdx.com 2003
        const feedKey = (Object.keys(feedNamesMapping) as CompanyCardFeed[]).find((feed) => feedType?.startsWith(feed));
    
        if (feedType?.includes(CONST.COMPANY_CARD.FEED_BANK_NAME.CSV)) {
            return CONST.COMPANY_CARDS.CARD_TYPE.CSV;
        }

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

    Add missing test for the getBankName function here to verify that when feedType is not passed / undefined, the function won't throw error, but instead return undefined.

  4. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Sep 15, 2025
  5. changed the title [-]Reports - App crashes after removing direct feed with assigned card transactions[/-] [+][$250] Reports - App crashes after removing direct feed with assigned card transactions[/+] on Sep 15, 2025
  6. melvin-bot commented on Sep 15, 2025

    @melvin-bot
  7. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Sep 15, 2025
  8. melvin-bot commented on Sep 15, 2025

    @melvin-bot

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

  9. jjcoffee commented on Sep 17, 2025

    @jjcoffee
    Contributor

    @ikevin127's proposal makes sense to me!

    🎀👀🎀 C+ reviewed

  10. melvin-bot commented on Sep 17, 2025

    @melvin-bot

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

  11. 10 remaining items

  12. changed the title [-][$250] Reports - App crashes after removing direct feed with assigned card transactions[/-] [+][Due for payment 2025-10-01] [$250] Reports - App crashes after removing direct feed with assigned card transactions[/+] on Sep 24, 2025
  13. melvin-bot commented on Sep 24, 2025

    @melvin-bot

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

  14. melvin-bot commented on Sep 24, 2025

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.2.17-6 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-10-01. 🎊

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

    • @jjcoffee requires payment through NewDot Manual Requests
    • @ikevin127 requires payment through NewDot Manual Requests
  15. melvin-bot commented on Sep 24, 2025

    @melvin-bot

    @jjcoffee / @ikevin127 @twisterdotcom 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]

  16. jjcoffee commented on Oct 1, 2025

    @jjcoffee
    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 (eg. bug slipped through the normal regression and PR testing process on staging)
    • 2b. Reported on staging (eg. found during regression or PR testing)
    • 2d. 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/53122/files#r2394945279

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

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

      Link to issue: https://github.com/Expensify/Expensify/issues/553335

    Regression Test Proposal

    Test:

    1. Login with a new account, create a workspace and go to workspace settings > Company cards.
    2. Click Add cards and proceed to add a Direct feed card by either using a real card from one of the bank options or click Other and use test credentials to add a faux BA via Plaid flow (only on staging server).
    3. Once BA flow is completed, on the Statement close date RHP click Submit to complete BA addition.
    4. On the Company cards page, click [+] Assign card and assign card to yourself > on Choose a transaction start date step keep default (From the beginning) > click Assign card.
    5. Navigate to Reports page, click Expenses and verify that you see multiple expenses originating from the company card assigned in the previous step.
    6. Navigate to workspace settings > Company cards and click Settings > Remove card feed and confirm Delete.
    7. Navigate to Reports page.
    8. Verify that upon navigation to the Reports page, the app will not crash.

    Do we agree 👍 or 👎

  17. melvin-bot commented on Oct 1, 2025

    @melvin-bot

    Payment Summary

    Upwork Job

    BugZero Checklist (@twisterdotcom)

    • (if NewFeature) I have created a PR for any necessary HelpDot updates, or I confirmed no updates are necessary.
    • I have verified the correct assignees and roles are listed above and updated the necessary manual offers
    • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants/1967598674017384654/hired)
    • I have verified the PR was not reverted
    • I have applied any discounts due to bugs/regressions introduced by this PR
    • I have paid out the Upwork contracts or cancelled the ones that are incorrect
    • I have verified the payment summary above is correct
  18. JmillsExpensify commented on Oct 6, 2025

    @JmillsExpensify
    Contributor

    $250 approved for @ikevin127

  19. garrettmknight commented on Oct 7, 2025

    @garrettmknight
    Contributor

    $250 approved for @jjcoffee

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

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions