You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Due for payment 2026-09-30] To-do-To-do becomes empty for Admin when Employee held the first report #100365
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor
Version Number: 9.4.72-0 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from BrowserStack:https://test-management.browserstack.com/projects/2219752/folder/53697186/test-cases/132213353 Email or phone of affected tester (no customers): N/A Issue reported by: Applause Internal Team Bug source: Regression TC Execution Device used: MacBook Air 26.6.2 Chrome, iPhone 15 iOS 26.6.1 App Component: Left Hand Navigation (LHN)
Action Performed:
As an Admin, create a workspace and invite an Employee
Set the yourself as the approver
As the Employee, submit a single-expense report
Submit a separate report with two expenses
As the Employee, open the single-expense report and place the expense on hold
As an Admin, open LHN - To-dos
Expected Result:
The two-expense report remains present in the Inbox To-do tab with an Approve action available
Actual Result:
The two-expense report is not present in the Admin's Inbox To-do tab, when the one-expense report was put on hold by Employee
For a workspace admin, the To-do row is the policy expense chat, not each expense report — so both reports A and B are represented by one LHN row. That row's To-do membership is decided by a single flag, requiresAttention (SidebarUtils.ts:973-975).
In getReasonAndReportActionThatRequiresAttention, the chat picks one representative child expense report and then applies the all-held exclusion to that one report — but uses the result to gate the whole chat:
getIOUReportActionWithBadge walks the chat's REPORTPREVIEW actions and keeps the oldest one that yields a badge. Report A was submitted first, and canApproveIOU has no hold awareness, so a fully-held report A still returns an APPROVE badge and wins the race. Report B is discarded.
iouReportID, transactions and isExcludedForHeldExpenses are all computed from report A only (ReportUtils.ts:4672-4683). Report A has exactly one expense, so hasOnlyHeldExpenses is true after a single hold, and didCurrentUserPlaceHoldOnReportExpense is false for the admin (the employee placed the hold) → isExcludedForHeldExpenses = true.
hasValidIOUAction is then false — and && !isExcludedForHeldExpenses overrides hasOutstandingChildRequest === true, so the correct server flag can't rescue it. No later branch matches, requiresAttention becomes false, and the chat row leaves the To-do tab, taking report B's pending approval with it.
The exclusion was added in #96178 (merged 2026-08-17). It excludes all-held reports correctly, but is evaluated after a single winner has been chosen instead of during selection.
Supporting evidence and things ruled out
Holding does not write shared state.putOnHold (Hold.ts:88-343) only touches the transaction, its thread, its violations, and report A's unheld* totals and nextStep. It writes no chatReport field, no hasOutstandingChildRequest, no policy or account key — so this is a read-side bug, not a data bug. The fix is entirely in the App repo.
No RBR fallback for the approver. The other half of the To-do filter, hasErrorsOtherThanFailedReceipt, is submitter-only (ReportUtils.ts:9868-9879), which is why the tab goes fully empty rather than leaving a red-dot row.
Why B doesn't get its own row. Expense reports only earn a separate To-do row when the approver has no access to the parent chat (ReportUtils.ts:4545-4564); a policy admin has that access.
Ordering dependency (good confirming test). The bug should only fire when the fully-held report's preview is the oldest. Holding the expense on the newer report instead should leave the To-do row intact.
Not verified: I analyzed this from code only — I did not run a live two-account repro, and there is no server-side log that records the client's requiresAttention decision.
What changes do you think we should make in order to solve the problem?
Move the all-held exclusion inside the candidate selection in getIOUReportActionWithBadge (or in getBadgeFromIOUReport), so a fully-held child report is skipped while choosing earliestAction and a still-approvable sibling wins instead. Keep the existing carve-out per report: a fully-held report where the current user placed the hold should still be selectable, since they can remove it.
getReasonAndReportActionThatRequiresAttention can then drop the chat-wide isExcludedForHeldExpenses gate on ReportUtils.ts:4689-4692, because a chat with no selectable child will already produce no badge action.
Regression tests to add alongside the existing ones from #96178: a chat with two submitted reports where the older one is fully held by the submitter must keep requiresAttention === true for the approver; and the single-report case must stay excluded.
What alternative solutions did you explore?
Make canApproveIOU hold-aware. Cleaner in principle, but it feeds the Approve button and the Home/Spend to-dos too, so it risks changing behavior well beyond the LHN.
Only apply the exclusion when the chat has one child report. A narrow patch that leaves the same bug for three reports where the oldest two are held.
Rely on hasOutstandingChildRequest. Doesn't work: line 4692 explicitly overrides it.
Next Steps for Contributor+ team: To accept:@MelvinBot implement [this](https://github.com/Expensify/App/issues/100365) to create a draft PR. To refine:@MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.
In getIOUReportActionWithBadge (src/libs/actions/IOU/ReportWorkflow.ts:383), we iterate through all REPORT_PREVIEW actions in the chat to select the earliestAction with an action badge. When multiple child reports exist (such as Report A submitted first, followed by Report B), Report A is selected as earliestAction because its preview action is older.
However, when an employee places the only expense in Report A on hold, Report A cannot be approved by the admin.
Back in getReasonAndReportActionThatRequiresAttention (src/libs/ReportUtils.ts:4689-4693), the function inspects only this single returned candidate (iouReportActionToApproveOrPay). It calculates hasAllExpensesHeld = true and isExcludedForHeldExpenses = true, causing hasValidIOUAction to be false and returning null. Because getIOUReportActionWithBadge does not filter out held reports and getReasonAndReportActionThatRequiresAttention has no fallback mechanism to evaluate subsequent report previews, the entire chat disappears from the Admin's To-do list despite Report B actively waiting for approval.
What changes do you think we should make in order to solve the problem?
Move the held-report exclusion check directly into getIOUReportActionWithBadge in src/libs/actions/IOU/ReportWorkflow.ts:
Inside the REPORT_PREVIEW loop, after validating that iouReport exists and has a badge from getBadgeFromIOUReport:
Check if all transactions of the child report are held (hasOnlyHeldExpenses).
If all expenses are held and the current user did not place the hold (!didCurrentUserPlaceHoldOnReportExpense(...)), skip this action (continue;).
Only consider the action for earliestAction if it is not excluded.
This ensures getIOUReportActionWithBadge returns the oldest actionable child report (Report B in the repro). getReasonAndReportActionThatRequiresAttention will then receive a valid candidate, keeping requiresAttention = true and preserving the workspace chat in the Admin's To-do tab.
We should also add a regression test in ReportUtilsTest covering a chat with two submitted expense reports where the earlier report is held by the employee and the later report is awaiting admin approval.
What alternative solutions did you explore? (Optional)
Filtering inside getReasonAndReportActionThatRequiresAttention: Loop back through all report previews if the chosen action is excluded. Rejected because it duplicates iteration logic and breaks the single responsibility of getIOUReportActionWithBadge (which is meant to select the actionable preview).
Modifying canApproveIOU: Adding hold checks inside canApproveIOU. Rejected because canApproveIOU is consumed by other UI components (such as action buttons and report views) where held reports still need to display their approvable status once unheld.
📣 @Anthgg! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:
Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>
[Contributor] The offending PR and associated issue have been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
[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:
[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.
As an admin (account A), create a Collect or Control workspace and invite an employee (account B).
In Workspace settings > Workflows, turn on Add approvals and set account A as the approver.
As B, submit report 1 with a single expense to that workspace. Once it has submitted, submit report 2 with two expenses to the same workspace, so report 1 is the older of the two.
As B, open report 1 and put its expense on hold.
As A, open the To-dos tab in the LHN. Verify the workspace chat is still listed with an Approve badge, and that opening it lands on report 2 — the approvable sibling — not on the held report 1.
As B, remove the hold from report 1 and instead put both expenses in report 2 on hold.
As A, verify the To-dos row is still listed and its Approve badge now targets report 1.
As B, remove the remaining holds. Verify A still sees the chat in To-dos.
It added the chat-wide isExcludedForHeldExpenses gate at src/libs/ReportUtils.ts:4544 and ANDed it into hasValidIOUAction at ReportUtils.ts:4550-4553. The gate is computed from a single representative child report but applied to the whole policy expense chat, so a fully-held report hid its still-approvable sibling.
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor
Activity
applause-bot commentedon Sep 4, 2026
While Applause doesn't embed attachments for this bug, here are the links for quick view:
https://platform.applause.com/services/links/v1/external/0cb9448accb8067a34961282fca5c7d4fbddc221c59b5ccdb747b770fa5e05e6
MelvinBot commentedon Sep 4, 2026
Proposal
What is the root cause of that problem?
For a workspace admin, the To-do row is the policy expense chat, not each expense report — so both reports A and B are represented by one LHN row. That row's To-do membership is decided by a single flag,
requiresAttention(SidebarUtils.ts:973-975).In
getReasonAndReportActionThatRequiresAttention, the chat picks one representative child expense report and then applies the all-held exclusion to that one report — but uses the result to gate the whole chat:getIOUReportActionWithBadgewalks the chat'sREPORTPREVIEWactions and keeps the oldest one that yields a badge. Report A was submitted first, andcanApproveIOUhas no hold awareness, so a fully-held report A still returns anAPPROVEbadge and wins the race. Report B is discarded.iouReportID,transactionsandisExcludedForHeldExpensesare all computed from report A only (ReportUtils.ts:4672-4683). Report A has exactly one expense, sohasOnlyHeldExpensesis true after a single hold, anddidCurrentUserPlaceHoldOnReportExpenseis false for the admin (the employee placed the hold) →isExcludedForHeldExpenses = true.hasValidIOUActionis thenfalse— and&& !isExcludedForHeldExpensesoverrideshasOutstandingChildRequest === true, so the correct server flag can't rescue it. No later branch matches,requiresAttentionbecomesfalse, and the chat row leaves the To-do tab, taking report B's pending approval with it.The exclusion was added in #96178 (merged 2026-08-17). It excludes all-held reports correctly, but is evaluated after a single winner has been chosen instead of during selection.
Supporting evidence and things ruled out
putOnHold(Hold.ts:88-343) only touches the transaction, its thread, its violations, and report A'sunheld*totals andnextStep. It writes nochatReportfield, nohasOutstandingChildRequest, no policy or account key — so this is a read-side bug, not a data bug. The fix is entirely in the App repo.hasErrorsOtherThanFailedReceipt, is submitter-only (ReportUtils.ts:9868-9879), which is why the tab goes fully empty rather than leaving a red-dot row.ReportUtils.ts:4545-4564); a policy admin has that access.requiresAttentiondecision.What changes do you think we should make in order to solve the problem?
Move the all-held exclusion inside the candidate selection in
getIOUReportActionWithBadge(or ingetBadgeFromIOUReport), so a fully-held child report is skipped while choosingearliestActionand a still-approvable sibling wins instead. Keep the existing carve-out per report: a fully-held report where the current user placed the hold should still be selectable, since they can remove it.getReasonAndReportActionThatRequiresAttentioncan then drop the chat-wideisExcludedForHeldExpensesgate onReportUtils.ts:4689-4692, because a chat with no selectable child will already produce no badge action.Regression tests to add alongside the existing ones from #96178: a chat with two submitted reports where the older one is fully held by the submitter must keep
requiresAttention === truefor the approver; and the single-report case must stay excluded.What alternative solutions did you explore?
canApproveIOUhold-aware. Cleaner in principle, but it feeds the Approve button and the Home/Spend to-dos too, so it risks changing behavior well beyond the LHN.hasOutstandingChildRequest. Doesn't work: line 4692 explicitly overrides it.Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/100365)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
view run
melvin-bot commentedon Sep 4, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @DylanDylann (
External)melvin-bot commentedon Sep 4, 2026
Unable to auto-create job on Upwork. The BZ team member should create it manually for this issue.
j3ffffff commentedon Sep 4, 2026
Anthgg commentedon Sep 4, 2026
Proposal
What is the root cause of that problem?
In
getIOUReportActionWithBadge(src/libs/actions/IOU/ReportWorkflow.ts:383), we iterate through allREPORT_PREVIEWactions in the chat to select theearliestActionwith an action badge. When multiple child reports exist (such as Report A submitted first, followed by Report B), Report A is selected asearliestActionbecause its preview action is older.However, when an employee places the only expense in Report A on hold, Report A cannot be approved by the admin.
Back in
getReasonAndReportActionThatRequiresAttention(src/libs/ReportUtils.ts:4689-4693), the function inspects only this single returned candidate (iouReportActionToApproveOrPay). It calculateshasAllExpensesHeld = trueandisExcludedForHeldExpenses = true, causinghasValidIOUActionto befalseand returningnull. BecausegetIOUReportActionWithBadgedoes not filter out held reports andgetReasonAndReportActionThatRequiresAttentionhas no fallback mechanism to evaluate subsequent report previews, the entire chat disappears from the Admin's To-do list despite Report B actively waiting for approval.What changes do you think we should make in order to solve the problem?
Move the held-report exclusion check directly into
getIOUReportActionWithBadgeinsrc/libs/actions/IOU/ReportWorkflow.ts:Inside the
REPORT_PREVIEWloop, after validating thatiouReportexists and has a badge fromgetBadgeFromIOUReport:hasOnlyHeldExpenses).!didCurrentUserPlaceHoldOnReportExpense(...)), skip this action (continue;).earliestActionif it is not excluded.This ensures
getIOUReportActionWithBadgereturns the oldest actionable child report (Report B in the repro).getReasonAndReportActionThatRequiresAttentionwill then receive a valid candidate, keepingrequiresAttention = trueand preserving the workspace chat in the Admin's To-do tab.We should also add a regression test in
ReportUtilsTestcovering a chat with two submitted expense reports where the earlier report is held by the employee and the later report is awaiting admin approval.What alternative solutions did you explore? (Optional)
getReasonAndReportActionThatRequiresAttention: Loop back through all report previews if the chosen action is excluded. Rejected because it duplicates iteration logic and breaks the single responsibility ofgetIOUReportActionWithBadge(which is meant to select the actionable preview).canApproveIOU: Adding hold checks insidecanApproveIOU. Rejected becausecanApproveIOUis consumed by other UI components (such as action buttons and report views) where held reports still need to display their approvable status once unheld.melvin-bot commentedon Sep 4, 2026
📣 @Anthgg! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:
Format:
Anthgg commentedon Sep 4, 2026
Contributor details
Your Expensify account email: anthgg17@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/~01974b42efa621eec0
melvin-bot commentedon Sep 4, 2026
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
melvin-bot commentedon Sep 7, 2026
@DylanDylann Whoops! This issue is 2 days overdue. Let's get this updated quick!
24 remaining items
DylanDylann commentedon Sep 23, 2026
BugZero Checklist:
[Contributor] The offending PR and associated issue have been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to the comment on the PR: [Payment due @eh2077] Exclude all-held reports from the Inbox to-do, keep them for whoever placed the hold #96178 (comment)
Link to the comment on the Issue:
[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:
[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: https://github.com/Expensify/Expensify/issues/687783
Regression Test Proposal
Test
Do we agree 👍 or 👎
Zapier Logs
Run ID: 00040eee-fc96-a779-a2a8-9010793ce8c4DylanDylann commentedon Sep 23, 2026
@MelvinBot Could you help find the offending PR that caused this bug?
MelvinBot commentedon Sep 23, 2026
Offending PR: [Payment due eh2077] Exclude all-held reports from the Inbox to-do, keep them for whoever placed the hold (
Expensify/App#96178) — merged 2026-08-17, authorallgandalf, reviewereh2077. Staging 9.4.55-0, production 9.4.55-4; this bug was reported on 9.4.72-0.It added the chat-wide
isExcludedForHeldExpensesgate atsrc/libs/ReportUtils.ts:4544and ANDed it intohasValidIOUActionatReportUtils.ts:4550-4553. The gate is computed from a single representative child report but applied to the whole policy expense chat, so a fully-held report hid its still-approvable sibling.Why this PR and not an earlier one
ReportWorkflow.ts:414predates [Payment due @eh2077] Exclude all-held reports from the Inbox to-do, keep them for whoever placed the hold #96178 and is harmless on its own — before the gate existed, the winning report being held changed nothing, and the chat kept its To-do row. [Payment due @eh2077] Exclude all-held reports from the Inbox to-do, keep them for whoever placed the hold #96178 is what turned that pre-existing "one report represents the chat" assumption into a visible regression.Expensify/App#92499) is not the offender: it only touched the Home/Spend to-dos, notrequiresAttention, which is what drives the Inbox To-do tab. [Payment due @eh2077] Exclude all-held reports from the Inbox to-do, keep them for whoever placed the hold #96178's own description says so explicitly.Expensify/App#100784), confirms the causal link: it removes exactly the lines [Payment due @eh2077] Exclude all-held reports from the Inbox to-do, keep them for whoever placed the hold #96178 added and re-applies the same exclusion during candidate selection ingetBadgeFromIOUReport, keeping the chat-wide gate only for the fallback path where no candidate was selected.TodosUtils.tsin [Payment due @eh2077] Exclude all-held reports from the Inbox to-do, keep them for whoever placed the hold #96178 got the per-report treatment right (!allExpensesHeld || currentUserPlacedHoldevaluated per expense report). Only theReportUtils.tshalf applied a per-report verdict to a chat that can own many reports.Not verified in a browser — I could not drive a live session this run, so this is a code-and-history conclusion, not a bisect against builds.
For the BugZero checklist,
allgandalfandeh2077are the people to notify on #96178.view run
melvin-bot commentedon Sep 29, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)melvin-bot commentedon Sep 29, 2026
Payment Summary
Resolving PRs:
Fix: keep the To-do row when only an older sibling expense report is fully held #100784
Reviewer: @DylanDylann owed $175 via NewDot
BugZero Checklist (@mallenexpensify)
mallenexpensify commentedon Oct 1, 2026
Payment Summary
Contributor+: @DylanDylann due $250 via NewDot
quinthar commentedon Oct 27, 2026
Approved $250 to @DylanDylann