Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Due for payment 2025-02-19] [Due for payment 2025-02-18] Android & iOS - Reports - App crashes when tapping Filters icon after opening View transactions from card page #56519

Open
4 of 8 tasks
IuliiaHerets opened this issue Feb 7, 2025 · 20 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Engineering External Added to denote the issue can be worked on by a contributor Weekly KSv2

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Feb 7, 2025

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 9.0.95-0
Reproducible in staging?: Yes
Reproducible in production?: No
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Yes, reproducible on both
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): [email protected]
Issue reported by: Applause Internal Team
Device used: Samsung Galaxy Z Fold 4 / Android 14
App Component: Search

Action Performed:

Precondition:

  • User is workspace owner and has assigned themselves a virtual card.
  1. Launch ND or hybrid app.
  2. Go to Account settings > Wallet.
  3. Tap Report virtual card fraud.
  4. Tap Deactivate card.
  5. Enter magic code.
  6. Tap Got it, thanks.
  7. Tap View transactions.
  8. On Reports page, tap Filters icon.

Expected Result:

App will not crash and Filters page will open.

Actual Result:

App crashes.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

https://github.com/user-attachments/assets/7f26cc8e-d4a5-429d-a2c0-8b75fc071ff3
Bug6735975_1738913614019!log.txt

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @alexpensify
@IuliiaHerets IuliiaHerets added Bug Something is broken. Auto assigns a BugZero manager. DeployBlockerCash This issue or pull request should block deployment labels Feb 7, 2025
Copy link

melvin-bot bot commented Feb 7, 2025

Triggered auto assignment to @madmax330 (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

Copy link

melvin-bot bot commented Feb 7, 2025

Triggered auto assignment to @alexpensify (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.

Copy link

melvin-bot bot commented Feb 7, 2025

💬 A slack conversation has been started in #expensify-open-source

@melvin-bot melvin-bot bot added the Daily KSv2 label Feb 7, 2025
@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels Feb 7, 2025
Copy link
Contributor

github-actions bot commented Feb 7, 2025

👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

@IuliiaHerets
Copy link
Author

Not repro on production

screen-20250207-095051.mp4

@mkzie2
Copy link
Contributor

mkzie2 commented Feb 7, 2025

Proposal

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

App crashes.

What is the root cause of that problem?

After deactivating the card, card has only a field {isLoading: false}. Then the app crashes when we call getBankName function here with card.bank is undefined

const feedKey = (Object.keys(feedNamesMapping) as CompanyCardFeed[]).find((feed) => feedType.startsWith(feed));

const humanReadableBankName = card.bank === CONST.EXPENSIFY_CARD.BANK ? CONST.EXPENSIFY_CARD.BANK : getBankName(card.bank as CompanyCardFeed);

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

We can also return early if card.cardID is undefined or we shouldn't cast the type here, change the type of feedType to undefined and then return early in getBankName function if feedType is undefined.

if (!card) {
return '';
}

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

NA

What alternative solutions did you explore? (Optional)

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.

@NJ-2020
Copy link
Contributor

NJ-2020 commented Feb 7, 2025

Proposal

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

Android & iOS - Reports - App crashes when tapping Filters icon after opening View transactions from card page

What is the root cause of that problem?

As we can see from the error

Image

In line 219, we're trying to convert the cardID property to string which doesn't exist in card value which cause the app to crash

return filterValue
? Object.values(cards)
.filter((card) => filterValue.includes(card.cardID.toString()))

The card value is taken from here

cardID: {
getTitle: getFilterCardDisplayTitle,
description: 'common.card' as const,

And getTitle is invoked that cardList is passed here

} else if (key === CONST.SEARCH.SYNTAX_FILTER_KEYS.CARD_ID) {
if (!shouldDisplayCardFilter) {
return;
}
filterTitle = baseFilterConfig[key].getTitle(searchAdvancedFilters, allCards);

And allCards value is taken from mergeCardListWithWorkspaceFeeds function

In mergeCardListWithWorkspaceFeeds function we don't filter any card that doesn't have any cardID like we do for workspace card feeds

App/src/libs/CardUtils.ts

Lines 101 to 110 in e7b38b9

function mergeCardListWithWorkspaceFeeds(workspaceFeeds: Record<string, WorkspaceCardsList | undefined>, cardList = allCards, shouldExcludeCardHiddenFromSearch = false) {
const feedCards: CardList = {};
Object.keys(cardList).forEach((cardKey) => {
const card = cardList[cardKey];
if (shouldExcludeCardHiddenFromSearch && isCardHiddenFromSearch(card)) {
return;
}
feedCards[cardKey] = card;
});

App/src/libs/CardUtils.ts

Lines 114 to 116 in e7b38b9

if (!isCard(card) || (shouldExcludeCardHiddenFromSearch && isCardHiddenFromSearch(card))) {
return;
}

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

We should filter the card like we do for workspace card feeds

Object.keys(cardList).forEach((cardKey) => {
    const card = cardList[cardKey];
    if (shouldExcludeCardHiddenFromSearch && isCardHiddenFromSearch(card) || !isCard(card)) {
        return;
    }
    feedCards[cardKey] = card;
});

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

We should create a test function an pass a cardList without a cardID and make sure the mergeCardListWithWorkspaceFeeds function returns nothing

What alternative solutions did you explore? (Optional)

@Kicu
Copy link
Member

Kicu commented Feb 10, 2025

Please assign me to this one and I can fix it, we had done a lot of work with Search and card filters

@melvin-bot melvin-bot bot added the Overdue label Feb 10, 2025
@Julesssss Julesssss added the External Added to denote the issue can be worked on by a contributor label Feb 10, 2025
Copy link

melvin-bot bot commented Feb 10, 2025

Unable to auto-create job on Upwork. The BZ team member should create it manually for this issue.

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Feb 10, 2025
Copy link

melvin-bot bot commented Feb 10, 2025

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

@melvin-bot melvin-bot bot removed the Overdue label Feb 10, 2025
@Julesssss
Copy link
Contributor

Assigning for C+ review first.

@Julesssss Julesssss assigned Kicu and unassigned suneox Feb 10, 2025
@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Feb 10, 2025
@Julesssss
Copy link
Contributor

Hey @Kicu, assigned. Thanks.

I also directly assigned @ikevin127 for C+ as he is online

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Hourly KSv2 labels Feb 10, 2025
@Julesssss Julesssss removed the DeployBlockerCash This issue or pull request should block deployment label Feb 11, 2025
@Julesssss
Copy link
Contributor

Fix on staging

@Julesssss Julesssss assigned Julesssss and unassigned madmax330 Feb 11, 2025
@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Feb 11, 2025
@melvin-bot melvin-bot bot changed the title Android & iOS - Reports - App crashes when tapping Filters icon after opening View transactions from card page [Due for payment 2025-02-18] Android & iOS - Reports - App crashes when tapping Filters icon after opening View transactions from card page Feb 11, 2025
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Feb 11, 2025
Copy link

melvin-bot bot commented Feb 11, 2025

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

Copy link

melvin-bot bot commented Feb 11, 2025

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.95-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-02-18. 🎊

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

  • @Kicu does not require payment (Contractor)
  • @ikevin127 requires payment (Needs manual offer from BZ)

Copy link

melvin-bot bot commented Feb 11, 2025

@ikevin127 @alexpensify @ikevin127 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]

@Kicu
Copy link
Member

Kicu commented Feb 11, 2025

went super smooth 👍

@ikevin127
Copy link
Contributor

ikevin127 commented Feb 11, 2025

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/55900/files#r1951480523.

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

Regression Test Proposal

Precondition: User is workspace owner and has assigned themselves a virtual card.

  1. Go to Account settings > Wallet.
  2. Tap on virtual card > Report virtual card fraud.
  3. Tap Deactivate card.
  4. Enter magic code.
  5. Tap Got it, thanks.
  6. Tap View transactions.
  7. Once on Reports page, verify that tapping the Filters icon and opening the Filters page won't crash the app.

Do we agree 👍 or 👎.

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Feb 12, 2025
@melvin-bot melvin-bot bot changed the title [Due for payment 2025-02-18] Android & iOS - Reports - App crashes when tapping Filters icon after opening View transactions from card page [Due for payment 2025-02-19] [Due for payment 2025-02-18] Android & iOS - Reports - App crashes when tapping Filters icon after opening View transactions from card page Feb 12, 2025
Copy link

melvin-bot bot commented Feb 12, 2025

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.96-1 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-02-19. 🎊

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

  • @Kicu does not require payment (Contractor)
  • @ikevin127 requires payment (Needs manual offer from BZ)

Copy link

melvin-bot bot commented Feb 12, 2025

@ikevin127 @alexpensify @ikevin127 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]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Engineering External Added to denote the issue can be worked on by a contributor Weekly KSv2
Projects
None yet
Development

No branches or pull requests

9 participants