Skip to content

[Due for payment 2026-10-23] MARKED_REIMBURSED sibling PAY check does not use the Search snapshot's report actions #102105

Closed

Description

@MelvinBot

Follow-up from [No QA] Hide redundant MARKEDREIMBURSED action when report has a sibling IOU pay action (review thread).

Problem

hasSiblingPayReportAction resolves sibling actions exclusively from the global Onyx collection via getAllReportActions(reportID):

src/libs/ReportActionsUtils.ts:1892-1901

Search takes a different path. getReportActionsSections iterates report actions out of the SearchResults.data snapshot and calls isReportActionVisible with them:

src/libs/SearchUIUtils.ts:2549

That snapshot is never passed down to the sibling lookup. So for a CHAT search result whose report timeline has not been loaded into the normal Onyx collection, getAllReportActions returns an empty collection, the helper returns false early, and the redundant MARKED_REIMBURSED row still renders next to its PAY sibling in search results.

Proposed fix

Thread the caller's report-action collection into hasSiblingPayReportAction (and through isReportActionVisible / shouldReportActionBeVisible) instead of relying solely on the global Onyx connection, so the search snapshot is used when present.

Notes

This is not a regression — before the PR the duplicate showed everywhere, so search is no worse than the original bug. It's only the one surface the new check doesn't cover yet.

Issue OwnerCurrent Issue Owner: @mallenexpensify

Activity

  1. huult commented on Oct 2, 2026

    @huult
    Contributor

    @roryabraham Could you take a look at this PR when you have time?

  2. roryabraham commented on Oct 5, 2026

    @roryabraham
    Contributor

    Issue seems reasonable @huult. I don't see a PR yet

  3. huult commented on Oct 6, 2026

    @huult
    Contributor

    @roryabraham Just to confirm, would you like me to open a PR for this issue?

  4. roryabraham commented on Oct 6, 2026

    @roryabraham
    Contributor

    yes

  5. huult commented on Oct 7, 2026

    @huult
    Contributor

    @MelvinBot Please implement this ticket.

  6. MelvinBot commented on Oct 7, 2026

    @MelvinBot
    ContributorAuthor

    🤖 Draft PR created: #103301
    Please mark it as "Ready for review" or ask me to do that for you when it is ready for review.

    What changed: The MARKED_REIMBURSED sibling PAY check now uses the Search snapshot's report actions when the report's timeline isn't loaded into Onyx. Reports already loaded into Onyx behave as before.

    • hasSiblingPayReportAction takes an optional fallback collection and uses it only when the action isn't in Onyx.
    • shouldReportActionBeVisible and isReportActionVisible forward an optional reportActions argument.
    • getReportActionsSections passes the snapshot's report actions for each report.

    Tests: I added two unit tests. They fail without the fix and pass with it. Lint, typecheck, format, spellcheck, and the related test suites pass. I didn't run a manual UI check. Reproducing it needs a report with a stale OldDot MARKED_REIMBURSED plus a PAY action, which isn't available on a dev account. The human co-author still needs to fill in the Tests and QA sections.

  7. 7 remaining items

  8. ikevin127 commented on Oct 17, 2026

    @ikevin127
    Contributor

    BugZero Checklist

    • [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/95015/changes#diff-b8041d6cb129cc7b8a6223f8ffa570e79c326d8ea4affbad35c33cf6c8ea660dR1897

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

    1. As a workspace admin, go to Workspace > Workflows and set up Payments with a verified business bank account.
    2. As an employee, submit an expense to the workspace.
    3. As the admin, approve the report, then pay it with Pay $X as a business using the workspace business bank account.
    4. Open the report and verify it shows the "paid with bank account XXXX" report action comment.
    5. Go to Account > Troubleshoot > Clear cache and restart > Reset and refresh.
    6. Without opening the report, go to Spend > Filters > Type > Chat.
    7. Verify that the paid report shows only the "paid with bank account XXXX" row, with no extra "marked as paid" row next to it.

    Do we agree 👍 or 👎.

  9. melvin-bot commented on Oct 22, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  10. melvin-bot commented on Oct 22, 2026

    @melvin-bot

    Payment Summary

    Resolving PRs:

    BugZero Checklist (@mallenexpensify)

    • I have confirmed assignees, roles, and Upwork contracts look correct
    • I have paid out Upwork contracts / manual NewDot requests
    • [BugZero Assignee] I have created a GH issue for creating/updating the regression test once above steps have been agreed upon
  11. mallenexpensify commented on Oct 26, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor: @huult due $175 via NewDot
    Contributor+: @ikevin127 due $175 via NewDot

  12. ikevin127 commented on Oct 26, 2026

    @ikevin127
    Contributor

    @mallenexpensify Huult was author, I was reviewer, we're both due payment here 🙌

    image

  13. mallenexpensify commented on Oct 26, 2026

    @mallenexpensify
    Contributor

    @ikevin127 paid, summary updated above. Thx. Apologies for missing ya

  14. quinthar commented on Oct 27, 2026

    @quinthar
    Contributor

    Approved $175 to @ikevin127

  15. JmillsExpensify commented on Nov 14, 2026

    @JmillsExpensify
    Contributor

    $175 approved for @huult

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 productionDailyKSv2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions