Skip to content

[$250] Reports - After moving expense and deleting all expenses, table header remains in blank page #62507

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

Open
4 of 8 tasks
nlemma opened this issue May 21, 2025 · 16 comments
Open
4 of 8 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors

Comments

@nlemma
Copy link

nlemma commented May 21, 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.1.48-0
Reproducible in staging?: Yes
Reproducible in production?: Unable to check
If this was caught during regression testing, add the test name, ID and link from TestRail: #62270
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause Internal Team
Device used: Mac 15.4 / Chrome
App Component: Search

Action Performed:

  1. Go to staging.new.expensify.com
  2. Create two workspace chats.
  3. Submit one expense to each workspace chat.
  4. Go to Reports.
  5. Go to Expense Reports.
  6. Select one of the expenses via checkbox.
  7. Click dropdown button.
  8. Click Move expense.
  9. Select the unselected report.
  10. Select all expenses via checkbox.
  11. Click dropdown button > Delete.
  12. Delete the expenses.

Expected Result:

Table header will disappear.
Empty state will show up.

Actual Result:

Table header does not disappear.
Empty state does not show up.

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

Bug6838556_1747855043695.20250522_030739.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021925294263743135596
  • Upwork Job ID: 1925294263743135596
  • Last Price Increase: 2025-05-21
Issue OwnerCurrent Issue Owner: @
@nlemma nlemma added DeployBlockerCash This issue or pull request should block deployment Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels May 21, 2025
Copy link

melvin-bot bot commented May 21, 2025

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.

Copy link

melvin-bot bot commented May 21, 2025

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

Copy link

melvin-bot bot commented May 21, 2025

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

@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels May 21, 2025
Copy link
Contributor

👋 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.

@nlemma
Copy link
Author

nlemma commented May 21, 2025

@bfitzexpensify FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors.

@nabi-ebrahimi
Copy link
Contributor

Can see the move expense option btw.

@puneetlath puneetlath added Daily KSv2 External Added to denote the issue can be worked on by a contributor and removed DeployBlockerCash This issue or pull request should block deployment Hourly KSv2 labels May 21, 2025
@melvin-bot melvin-bot bot changed the title Reports - After moving expense and deleting all expenses, table header remains in blank page [$250] Reports - After moving expense and deleting all expenses, table header remains in blank page May 21, 2025
Copy link

melvin-bot bot commented May 21, 2025

Job added to Upwork: https://www.upwork.com/jobs/~021925294263743135596

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

melvin-bot bot commented May 21, 2025

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

@puneetlath
Copy link
Contributor

This doesn't really seem blocker-worth to me. Is the expectation that you would see the empty state UI after deleting the last expense?

@nkdengineer
Copy link
Contributor

nkdengineer commented May 21, 2025

🚨 Edited by proposal-police: This proposal was edited at 2025-05-21 21:45:10 UTC.

Proposal

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

Table header does not disappear.
Empty state does not show up.

What is the root cause of that problem?

After we move expense, we still have the previous report data but with transaction is empty array

Image

So the condition to show empty state here returns false

if (shouldShowEmptyState(isDataLoaded, data.length, searchResults.search.type)) {

And we return null in here if user is non-beta

if (isEmptyReport && !canUseTableReportView) {
return null;
}

Note: If you turn on beta, you will see the report with no expense.

Image

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

if not beta then we can update shouldShowEmptyState by passing in data and checking if there are any transactions in the data, otherwise return true

    const isHasAnyTransactions = data.some((item) => item?.transactions?.length > 0);
    if (!isHasAnyTransactions) {
        return true;
    }

if (shouldShowEmptyState(isDataLoaded, data.length, searchResults.search.type)) {

function shouldShowEmptyState(isDataLoaded: boolean, dataLength: number, type: SearchDataTypes) {
return !isDataLoaded || dataLength === 0 || !Object.values(CONST.SEARCH.DATA_TYPES).includes(type);
}

Or we can consider removing this condition or showing the UI to the user that we still have a report but no expense.

if (isEmptyReport && !canUseTableReportView) {
return null;
}

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)

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.

Copy link
Contributor

⚠️ @nkdengineer Thanks for your proposal. Please update it to follow the proposal template, as proposals are only reviewed if they follow that format (note the mandatory sections).

@nkdengineer
Copy link
Contributor

@alitoshmatov what do you think about my proposal here?

@melvin-bot melvin-bot bot added the Overdue label May 26, 2025
@alitoshmatov
Copy link
Contributor

@nkdengineer Thank you for your proposal. Your RCA is correct and solution works. I think we should check reports for empty transactions.

We can go with @nkdengineer 's proposal

C+ reviewed 🎀 👀 🎀

@melvin-bot melvin-bot bot removed the Overdue label May 27, 2025
Copy link

melvin-bot bot commented May 27, 2025

Current assignee @puneetlath is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.

@puneetlath
Copy link
Contributor

Hmm, interesting. So if you're in the beta everything works correctly. I'm not sure this is worth doing anything about then, since it'll naturally fix itself shortly when the beta becomes live. What do you think @bfitzexpensify?

@nkdengineer
Copy link
Contributor

I think even though the issue will resolve itself when the beta goes live, we should still consider fixing it now because this bug creates a poor experience for non-beta users right now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors
Projects
None yet
Development

No branches or pull requests

6 participants