Skip to content

[Due for payment 2026-10-30] Two "marked as paid" messages are shown after switching to table view and paying invoice #104676

Closed

Description

@applause-bot

If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.


Version Number: 9.5.16-0
Reproducible in staging?: Yes
Reproducible in production?: N/A - new feature, doesn't exist in prod
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #103703
Email or phone of affected tester (no customers): [email protected]
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:

Precondition:

  • User has received an invoice.
  1. Go to staging.new.expensify.com
  2. Open invoice report.
  3. Click More > Switch to table view.
  4. Bulk select the invoice.
  5. Click Pay > Pay as an individual > Mark as paid.

Expected Result:

Only one "marked as paid" message will be shown.

Actual Result:

Two "marked as paid" messages are shown after switching to table view and paying invoice via bulk select.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7292634_1792620389926.15.1.mp4

View all open jobs on GitHub

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

Issue OwnerCurrent Issue Owner: @daledah

Activity

  1. applause-bot commented on Oct 22, 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/845e92f5dea742bc354e61e4fe4185091708b726080a840976e262b786e4d00d

  2. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Oct 22, 2026
  3. melvin-bot commented on Oct 22, 2026

    @melvin-bot

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

  4. melvin-bot commented on Oct 22, 2026

    @melvin-bot

    @Beamanator @mountiny @lakchote @daledah you have been assigned to this deploy blocker because you reviewed the offending PR: #103703

  5. github-actions commented on Oct 22, 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. melvin-bot commented on Oct 22, 2026

    @melvin-bot

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

  7. MelvinBot commented on Oct 22, 2026

    @MelvinBot
    Contributor

    Deploy Blocker Analysis

    Causing PR: Reapply "Add a More menu option to switch single-expense reports between expense view and table view" — high confidence.

    Root cause: In table view, one "Mark as paid" click on an invoice calls payInvoice twice. The invoice menu item pays through its own onSelected, and the bulk action bar pays again through onSubItemSelected. Each call adds its own optimistic "marked as paid" action and sends its own PayInvoice request.

    Recommendation: Revert the PR. It is a new feature with several other open blockers on 9.5.16-0, and this bug sends duplicate payment requests.

    Investigation details

    Why this PR: It lets single-expense reports use table view and the selection toolbar (MoneyRequestReportUtils.ts:172-177, ReportSecondaryActionUtils.ts:1235). Invoice reports have one expense, so you could not bulk-pay an invoice before this PR. The double-pay path already existed but was unreachable.

    Double call chain:

    1. Invoice "Mark as paid" items set onSelected: () => onPress(...) (usePaymentOptions.ts:204-230). Non-invoice items have no onSelected, so only invoices are affected.
    2. PopoverMenu calls onItemSelected(item) and then item.onSelected() for the same click (PopoverMenu/index.tsx:536-551). onSelected → confirmPayment → payInvoice (call 1).
    3. onItemSelected forwards to onSubItemSelected (BulkActionBarButton.tsx:105-106). ELSEWHERE counts as a payment option, so it calls onSelectionModePaymentSelect (SelectionBulkActionBar.tsx:84-92) → selectPaymentType → confirmPayment → payInvoice (call 2).
    4. payInvoice does not check whether the invoice is already paid (PayMoneyRequest.ts:1132).
    5. Narrow layouts (Android/iOS) take the same double path through MoneyReportHeaderKYCDropdown.tsx:99-111.

    The second call also drops payAsBusiness. So "Pay as a business > Mark as paid" sends one business payment and one individual payment.

    Roll-forward fix (if you prefer not to revert):

    • In SelectionBulkActionBar.tsx and MoneyReportHeaderKYCDropdown.tsx, return early when the item has its own onSelected:
      if (!isSecondaryActionAPaymentOption(item) || item.onSelected) {
          return;
      }
    • In useSelectionModePayment.ts, wrap the invoice leaf handlers with runPaymentAction(...), as SettlementButton does, so delegate, locked-account, and validation checks still run.
    • Add a test that bulk-paying one invoice in table view calls PAY_INVOICE exactly once, for both individual and business.

    I traced this by reading code at beec381. I did not reproduce it in the app.

    Possible code review rule: A menu item with its own onSelected should not also be handled by the parent's onItemSelected/onSubItemSelected. One click should run the action once.


    view run

  8. m-natarajan commented on Oct 22, 2026

    @m-natarajan

    PR reverted and feature "Switch to table view." not available. iPhone 12/iOS 27.0.1, Samsung Galaxy A40/Android 11, Windows 10/Chrome/Build 9.5.16-1

    MicrosoftTeams-video.43.mp4
    MicrosoftTeams-video.42.mp4
    2026-10-22.16-02-19.mp4
  9. Beamanator commented on Oct 22, 2026

    @Beamanator
    Contributor

    thanks! closing!

  10. changed the title [-]Two "marked as paid" messages are shown after switching to table view and paying invoice[/-] [+][Due for payment 2026-10-30] Two "marked as paid" messages are shown after switching to table view and paying invoice[/+] on Oct 23, 2026
  11. melvin-bot commented on Oct 23, 2026

    @melvin-bot

    @daledah

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.5.18-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 2026-10-30. 🎊

    The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the Contributor+ 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

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2Engineering

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions