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
[$250] Expense - Unreported per diem expense cannot be added to report. #83712
👋 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:
Identify the pull request that introduced this issue and revert it.
Classification: Frontend bug Causing PR: #81446 - "Fix - Make it more apparent in the expense chat carousel view when expenses are added to a report" by @FitseTLT (Medium confidence) Related Issues: None found
Recommendation: REVERT
PR #81446 introduced changes to highlight new expenses when added to reports. While the primary changes were to the UI highlighting logic, it modified the useNewTransactions hook by adding prevTransactions to the dependency array and introduced useIsFocused checks. These changes may be causing unintended side effects or race conditions that break the "add to report" functionality specifically for per diem expenses.
Reasoning:
Bug is staging-only (not in production), indicating it was introduced in this release
Bug specifically affects per diem expenses being added to reports after being made unreported
The PR modifies transaction tracking and preview rendering logic
The bug is specific to per diem expenses and the "add to report" flow
The issue reproduces on Android App, Android mWeb, and Windows Chrome (all platforms where the React components run)
Root Cause
The changes to useNewTransactions hook and the introduction of useIsFocused checks may be causing:
Race conditions in transaction state updates
Incorrect transaction filtering or identification
Focus-related side effects that interfere with the InteractionManager callbacks used in the add-to-report flow
The per diem-specific nature suggests the issue may relate to how the highlighting logic interacts with per diem custom unit checks in AddUnreportedExpense.tsx (lines 91-96).
Please re-state the problem that we are trying to solve in this issue.
After removing a per diem expense from a report (making it unreported), the user cannot re-add it to a report via the "Add expense" → "Unreported expense" flow. This is reproducible in staging (V9.3.27-0) but not in production.
What is the root cause of that problem?
PR #81742 (merged Feb 26) introduced a key format mismatch in AddUnreportedExpenseFooter.tsx.
The selector at line 50-53 creates a map with bare transaction IDs as keys:
This map is then passed as allTransactions to changeTransactionsReport at line 100. However, changeTransactionsReport in src/libs/actions/Transaction.ts:820 looks up transactions using Onyx collection-prefixed keys:
This expects keys like "transactions_abc123", but finds keys like "abc123". Every lookup returns undefined, the resulting array is empty after filtering, and the operation fails silently.
Why per diem is specifically affected: Per diem expenses always go to workspace expense reports (not IOU reports), so they always take the else branch at line 90 which calls changeTransactionsReport. The IOU report path (convertBulkTrackedExpensesToIOU) at line 77-89 was correctly refactored to use Object.values(selectedTransactions) (an array), but the expense report path was not.
Note: This likely also affects non-per-diem unreported expenses being added to workspace expense reports, though per diem is the most visible case.
What changes do you think we should make in order to solve the problem?
In src/components/AddUnreportedExpenseFooter.tsx, change the selector to use Onyx collection-prefixed keys so that changeTransactionsReport can find the transactions:
// Line 53: change fromacc[transaction.transactionID]=transaction;// toacc[`${ONYXKEYS.COLLECTION.TRANSACTION}${transaction.transactionID}`]=transaction;
What alternative solutions did you explore? (Optional)
An alternative would be to modify changeTransactionsReport to accept bare transaction IDs and look them up internally, but that would change the function's contract for all callers. The simpler fix is to align the key format in the selector.
Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, or @MelvinBot <your feedback> to refine this analysis.
Activity
melvin-bot commentedon Feb 27, 2026
Triggered auto assignment to @rlinoz (
DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.melvin-bot commentedon Feb 27, 2026
Triggered auto assignment to @heyjennahay (
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.melvin-bot commentedon Feb 27, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon Feb 27, 2026
👋 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:
OSBotify commentedon Feb 27, 2026
🔍 Investigation Summary
Classification: Frontend bug
Causing PR: #81446 - "Fix - Make it more apparent in the expense chat carousel view when expenses are added to a report" by @FitseTLT (Medium confidence)
Related Issues: None found
Recommendation: REVERT
PR #81446 introduced changes to highlight new expenses when added to reports. While the primary changes were to the UI highlighting logic, it modified the
useNewTransactionshook by addingprevTransactionsto the dependency array and introduceduseIsFocusedchecks. These changes may be causing unintended side effects or race conditions that break the "add to report" functionality specifically for per diem expenses.Reasoning:
useNewTransactionshook dependencies and theuseIsFocusedchecks could interfere with the add-to-report flowLabels: Keep DeployBlockerCash (App deploy is blocked - this is a frontend bug requiring an App PR fix)
📋 Detailed Analysis
Evidence
PR #81446 modified:
src/hooks/useNewTransactions.ts- AddedprevTransactionsto dependency array (was previously excluded with eslint-disable)src/components/ReportActionItem/MoneyRequestReportPreview/index.tsx- AddeduseIsFocusedanduseNewTransactionshooksThe bug occurs when:
Verification
Root Cause
The changes to
useNewTransactionshook and the introduction ofuseIsFocusedchecks may be causing:The per diem-specific nature suggests the issue may relate to how the highlighting logic interacts with per diem custom unit checks in
AddUnreportedExpense.tsx(lines 91-96).OSBotify commentedon Feb 27, 2026
Additional Context
Relevant File Paths:
/home/runner/_work/App/App/src/components/ReportActionItem/MoneyRequestReportPreview/index.tsx- Modified to add highlighting logic/home/runner/_work/App/App/src/hooks/useNewTransactions.ts- Dependency array changed/home/runner/_work/App/App/src/components/AddUnreportedExpenseFooter.tsx- Contains the add-to-report confirmation logic/home/runner/_work/App/App/src/pages/AddUnreportedExpense.tsx- Contains per diem filtering logic (lines 91-96)Next Steps:
@FitseTLT @situchan - As the author and reviewer of PR #81446, please review this analysis.
MelvinBot commentedon Feb 27, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
After removing a per diem expense from a report (making it unreported), the user cannot re-add it to a report via the "Add expense" → "Unreported expense" flow. This is reproducible in staging (V9.3.27-0) but not in production.
What is the root cause of that problem?
PR #81742 (merged Feb 26) introduced a key format mismatch in
AddUnreportedExpenseFooter.tsx.The selector at line 50-53 creates a map with bare transaction IDs as keys:
This map is then passed as
allTransactionstochangeTransactionsReportat line 100. However,changeTransactionsReportinsrc/libs/actions/Transaction.ts:820looks up transactions using Onyx collection-prefixed keys:This expects keys like
"transactions_abc123", but finds keys like"abc123". Every lookup returnsundefined, the resulting array is empty after filtering, and the operation fails silently.Why per diem is specifically affected: Per diem expenses always go to workspace expense reports (not IOU reports), so they always take the
elsebranch at line 90 which callschangeTransactionsReport. The IOU report path (convertBulkTrackedExpensesToIOU) at line 77-89 was correctly refactored to useObject.values(selectedTransactions)(an array), but the expense report path was not.Note: This likely also affects non-per-diem unreported expenses being added to workspace expense reports, though per diem is the most visible case.
What changes do you think we should make in order to solve the problem?
In
src/components/AddUnreportedExpenseFooter.tsx, change the selector to use Onyx collection-prefixed keys so thatchangeTransactionsReportcan find the transactions:What alternative solutions did you explore? (Optional)
An alternative would be to modify
changeTransactionsReportto accept bare transaction IDs and look them up internally, but that would change the function's contract for all callers. The simpler fix is to align the key format in the selector.Next Steps for Contributor+ team: Reply with
@MelvinBot implement thisto create a draft PR, or@MelvinBot <your feedback>to refine this analysis.7 remaining items
parasharrajat commentedon Feb 27, 2026
I am fixing it. From my PR.
parasharrajat commentedon Feb 27, 2026
Created the PR.
melvin-bot commentedon Feb 28, 2026
If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.
If a regression has occurred and you are the assigned CM follow the instructions here.
If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.
rlinoz commentedon Mar 2, 2026
Reverting this works #81742
But @parasharrajat is investigating if he can find a simple fix for it.
rlinoz commentedon Mar 2, 2026
CP request is here https://expensify.slack.com/archives/C07J32337/p1772469013538549
IuliiaHerets commentedon Mar 2, 2026
@rlinoz Chrome / v9.3.27-7
Passed
Screen.Recording.2026-03-02.at.20.12.00.mp4