Skip to content

[$250] Reports - "undefinedundefined" is shown briefly when switching group-by from "From" to "Card" #70802

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.2.15-9
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from TestRail: #67802
Email or phone of affected tester (no customers): sjdniojsdoisjo@gmail.com
Issue reported by: Applause Internal Team
Device used: Mac 15.5 / Chrome
App Component: Search

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to workspace chat.
  3. Create an expense in workspace chat.
  4. Go to Reports > Expenses.
  5. Search with group-by:from.
  6. Click Group-by button.
  7. Select Card and click Apply.

Expected Result:

The subtitle below user name will not show "undefinedundefined" when switching group-by from "From" to "Card".

Actual Result:

The subtitle below user name shows "undefinedundefined" briefly when switching group-by from "From" to "Card".

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Image
Bug6948105_1758198902155.Screen_Recording_2025-09-18_at_20.26.28.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021970487701513069863
  • Upwork Job ID: 1970487701513069863
  • Last Price Increase: 2025-09-23
Issue OwnerCurrent Issue Owner: @dominictb

Activity

  1. added
    Daily
    Bug
    on Sep 18, 2025
  2. melvin-bot commented on Sep 18, 2025

    @melvin-bot

    Triggered auto assignment to @bfitzexpensify (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. nyomanjyotisa commented on Sep 18, 2025

    @nyomanjyotisa
    Member

    Proposal

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

    Reports - "undefinedundefined" is shown briefly when switching group-by from "From" to "Card"

    What is the root cause of that problem?

    Subtitle text concatenation doesn't handle undefined values properly

    text={`${cardItem.cardName}${cardItem.lastFourPAN ? ` ${CONST.DOT_SEPARATOR} ` : ''}${cardItem.lastFourPAN}`}

    When switching from "From" to "Card" grouping, there's a brief moment during data reconstruction where cardItem.cardName and cardItem.lastFourPAN might be undefined

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

    We should add proper null/undefined checks

                                    text={`${cardItem.cardName ?? ''}${cardItem.lastFourPAN ? ` ${CONST.DOT_SEPARATOR} ` : ''}${cardItem.lastFourPAN ?? ''}`}

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

    None

    What alternative solutions did you explore? (Optional)

    None

  4. lorretheboy commented on Sep 18, 2025

    @lorretheboy
    Contributor

    Proposal

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

    "undefinedundefined" is shown briefly when switching group-by from "From" to "Card"

    What is the root cause of that problem?

    We cast data[key] as SearchCardGroup, but during the transition, data[key] is actually a SearchMemberGroup (from the "From" grouping). This type assertion is unsafe and causes the undefined properties

    App/src/libs/SearchUIUtils.ts

    Lines 1442 to 1445 in 353237f

    for (const key in data) {
    if (isGroupEntry(key)) {
    const memberGroup = data[key] as SearchMemberGroup;
    const personalDetails = data.personalDetailsList[memberGroup.accountID];

    App/src/libs/SearchUIUtils.ts

    Lines 1477 to 1480 in 353237f

    for (const key in data) {
    if (isGroupEntry(key)) {
    const cardGroup = data[key] as SearchCardGroup;
    const personalDetails = data.personalDetailsList[cardGroup.accountID];

    const withdrawalIDGroup = data[key] as SearchWithdrawalIDGroup;

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

    We should check if it valid data before continue (We can use existing util func to check if having, however, I couldn't find out them so I check manually)

                const groupEntry = data[key];
    
                if (!('accountID' in groupEntry) || ('cardID' in groupEntry) || ('entryID' in groupEntry)) {
                    continue;
                }
    
                const memberGroup = groupEntry;
    
    
    
    ....
    
    
                const groupEntry = data[key];
    
                if (!('cardID' in groupEntry) || !('cardName' in groupEntry) || !('lastFourPAN' in groupEntry)) {
                    continue;
                }
    
                const cardGroup = groupEntry;
    
    ....
    
                const groupEntry = data[key];
    
                if (!('entryID' in groupEntry) || !('bankName' in groupEntry)) {
                    continue;
                }
    
                const withdrawalIDGroup = groupEntry;

    Optional: Though we have fixed the root cause of issue, we still can have better null/undefined check here as well if needed

    text={`${cardItem.cardName}${cardItem.lastFourPAN ? ` ${CONST.DOT_SEPARATOR} ` : ''}${cardItem.lastFourPAN}`}

    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.

  5. moved this to Bugs and Follow Up Issues in #expensify-bugson Sep 23, 2025
  6. added
    External
    on Sep 23, 2025
  7. changed the title [-]Reports - "undefinedundefined" is shown briefly when switching group-by from "From" to "Card"[/-] [+][$250] Reports - "undefinedundefined" is shown briefly when switching group-by from "From" to "Card"[/+] on Sep 23, 2025
  8. melvin-bot commented on Sep 23, 2025

    @melvin-bot
  9. added
    Help Wanted
    on Sep 23, 2025
  10. melvin-bot commented on Sep 23, 2025

    @melvin-bot

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

  11. dominictb commented on Sep 24, 2025

    @dominictb
    Contributor

    I cannot reproduce this today on main. Could anyone? @lorretheboy @nyomanjyotisa

    Screen.Recording.2025-09-24.at.23.20.43.mov
  12. nyomanjyotisa commented on Sep 25, 2025

    @nyomanjyotisa
    Member

    Yeah, the issue is not reproducible on the latest main

  13. dominictb commented on Sep 25, 2025

    @dominictb
    Contributor

    @bfitzexpensify please close this.

  14. moved this from Bugs and Follow Up Issues to Done in #expensify-bugson Sep 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugDailyExternalHelp Wanted

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions