Skip to content

[Due for payment 2026-07-13] [$250] Home - Review 1 expense opens expense report instead of expense with violation #95089

Closed

Description

@applause-bot

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.4.26-0
Reproducible in staging?: Yes
Reproducible in production?: No
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #94299
Email or phone of affected tester (no customers): odinjsdojosdijiossojo@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Mac 26.5 / Chrome
App Component: Money Requests

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to workspace chat.
  3. Create two expenses without category.
  4. Go to Home.
  5. Click Review 2 expenses.
  6. Click Category and select any category.
  7. Close the report view.
  8. Click Review 1 expense.

Expected Result:

Expense RHP with missing category will open.

Actual Result:

Expense report RHP opens, showing both expenses with and without violation.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7196900_1782936931783.3.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Julia Ponikarchuk
Bug ID: 7196900

Issue OwnerCurrent Issue Owner: @ZhenjaHorbach
Upwork Automation - Do Not Edit

Activity

  1. added
    DeployBlockerCash
    Bug
    on Jul 1, 2026
  2. applause-bot commented on Jul 1, 2026

    @applause-bot
    Author

    While Applause doesn't embed attachments for this bug, here are the links for quick view:
    https://platform.applause.com/services/links/v1/external/f0b0f2ea920b38ef2c85c890fc7e254e4fd3c1bee6127384d648da63b4f9ee9a

  3. melvin-bot commented on Jul 1, 2026

    @melvin-bot

    You have been assigned to this deploy blocker because you recently merged this PR: #94299

  4. melvin-bot commented on Jul 1, 2026

    @melvin-bot

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

  5. github-actions commented on Jul 1, 2026

    @github-actions
    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.
  6. MelvinBot commented on Jul 1, 2026

    @MelvinBot
    Contributor

    Proposal

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

    When a single OPEN expense report contains multiple transactions but only one is flagged with a violation, pressing Review 1 expense on Home opens the whole expense report (showing every expense) instead of the RHP for the single flagged expense.

    What is the root cause of that problem?

    In useReviewFlaggedExpenses.ts:170, the handler decides between "open the report" and "open the single transaction thread" with:

    if (flaggedExpenses.length === 1 && isMoneyRequestReport(firstFlaggedReport)) {
        // navigate to the full EXPENSE_REPORT_RHP / REPORT_WITH_ID
    }

    The code comment says the shortcut is meant for a one-transaction report ("the transaction thread is a redundant duplicate of the report itself"), but the condition never checks how many transactions the report has:

    • flaggedExpenses.length === 1 means "one flagged expense across the user", not "the report has one expense".
    • isMoneyRequestReport only checks the report type (isIOUReport || isExpenseReport) — it is always true for an expense report.

    So in the repro, both expenses live in the same OPEN expense report. After fixing one category, exactly one expense is still flagged → flaggedExpenses.length === 1 is true and isMoneyRequestReport is true → it navigates to the full report (which still lists both expenses). The correct helper for the intended check already exists: isOneTransactionReport (report?.transactionCount === 1).

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

    Swap the type check for the transaction-count check in useReviewFlaggedExpenses.ts:170:

    if (flaggedExpenses.length === 1 && isOneTransactionReport(firstFlaggedReport)) {

    With this, a report holding 2 transactions (count !== 1) falls through to navigateToTransactionThread, which opens the RHP for the single flagged transaction — matching the Expected Result. The "open the report directly" shortcut is then correctly reserved for reports that genuinely hold only one expense. Add a unit test covering "1 flagged expense inside a multi-transaction report" to tests/unit/hooks/useReviewFlaggedExpenses.test.ts.

    Why it doesn't repro in production / relationship to PR #94299

    The buggy condition is not newly introduced by PR #94299 (the assigned PR) — that PR was a refactor that moved the logic out of the flaggedExpenses derived value, and the pre-refactor code used the equivalent count === 1 && isMoneyRequestReport(...). So reverting #94299 would not fix this; the fix should be applied directly. The "Review X expenses" row is new to this release, which is why it's not reproducible in production.

    Also worth confirming during implementation: transactionCount must be populated on OPEN expense reports for isOneTransactionReport to be reliable here.


    Next Steps for Contributor+ team:
    To accept: @MelvinBot implement [this](https://github.com/Expensify/App/issues/95089) to create a draft PR.
    To refine: @MelvinBot <your feedback>
    To reject: Explain why you are rejecting Melvin's proposal.

  7. cristipaval commented on Jul 2, 2026

    @cristipaval
    Contributor

    @MelvinBot implement this

  8. MelvinBot commented on Jul 2, 2026

    @MelvinBot
    Contributor

    🤖 Draft PR created: #95163
    Please mark it as "Ready for review" when it is ready for review.

    What it does: The Review row decided "open the report directly" vs "open the single transaction thread" using isMoneyRequestReport (a report type check that is always true for expense reports), so a lone flagged expense inside a multi-transaction report opened the whole report. Swapped it for isOneTransactionReport (transactionCount === 1) so a single flagged expense in a multi-transaction report opens its own thread — matching the Expected Result. Added unit + UI test coverage for both the multi-transaction (→ thread) and single-transaction (→ report directly) paths.

    Local checks passing: Prettier, typecheck-tsgo, ESLint, React Compiler compliance, and the affected Jest suites (useReviewFlaggedExpenses 9/9, ForYouSectionTest 20/20).

  9. added
    Reviewing
    on Jul 2, 2026
  10. 1 remaining item

  11. melvin-bot commented on Jul 2, 2026

    @melvin-bot
  12. changed the title [-]Home - Review 1 expense opens expense report instead of expense with violation[/-] [+][$250] Home - Review 1 expense opens expense report instead of expense with violation[/+] on Jul 2, 2026
  13. m-natarajan commented on Jul 2, 2026

    @m-natarajan

    Chrome /v9.4.26-5
    Passed

    REC-20260702172326.mp4
  14. ZhenjaHorbach commented on Jul 2, 2026

    @ZhenjaHorbach
    Contributor

    @cristipaval
    Let's close!

  15. cristipaval commented on Jul 2, 2026

    @cristipaval
    Contributor

    Thanks! Closing

  16. removed
    DeployBlockerCash
    on Jul 2, 2026
  17. added
    Daily
    and removed
    Reviewing
    Hourly
    on Jul 6, 2026
  18. changed the title [-][$250] Home - Review 1 expense opens expense report instead of expense with violation[/-] [+][Due for payment 2026-07-13] [$250] Home - Review 1 expense opens expense report instead of expense with violation[/+] on Jul 6, 2026
  19. melvin-bot commented on Jul 6, 2026

    @melvin-bot

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

  20. melvin-bot commented on Jul 6, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.27-2 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 2026-07-13. 🎊

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

    • @ZhenjaHorbach requires payment through NewDot Manual Requests
    • @truph01 requires payment through NewDot Manual Requests
  21. melvin-bot commented on Jul 6, 2026

    @melvin-bot

    @ZhenjaHorbach / @truph01 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]. If no checklist is needed for this issue, you can click: [no checklist button]

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

Metadata

Metadata

Labels

BugDailyEngineering

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions