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-04-16] LHN - "Fix" label is displayed on chat prevew after creating an expense with "0" amount. #86109
Version Number: 9.3.42-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:#85523 Email or phone of affected tester (no customers):ibellicotest+2250@gmail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Motorola MotoG60 / Android 12 (Hybrid app) App Component: Left Hand Navigation (LHN)
Action Performed:
Prerequisite: Account has at least one workspace.
Open the staging.new.expensify.com website.
Open any workspace chat.
Create a manual expense with "0" as amount.
Note that a "Fix" label appears on chat preview on LHN.
Open the just created expense.
Note that no error is visible on report.
Expected Result:
When an expense with "0" as amount is created, label on chat preview should displayed the same action as report.
Actual Result:
When a expense with "0" as amount is created, "Fix" is shown on label on LHN, despite no error being visible on report.
👋 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: #85192 - "feat: deep link to report preview or message that caused GBR/RBR" by @aimane-chnaif (High confidence) Related Issues: None
Recommendation: REVERT
PR #85192 should be reverted. It refactored the action badge logic and introduced a regression where $0 expenses incorrectly show a "Fix" badge in the LHN even though no error is visible on the report.
Labels: No label changes needed. The issue was initially linked to PR #85523, but that PR only made badges recompute more frequently when policy fields change. The actual bug was introduced by PR #85192 which refactored the red brick road / action badge logic.
📋 Detailed Analysis
Evidence
While PR #85523 was initially suspected (and mentioned in the issue), my investigation revealed that PR #85192 is the actual cause:
That function checks hasViolations parameter (line 657 of SidebarUtils.ts)
Returns a "Fix" reason if violations exist
$0 expenses likely have validation violations, triggering the "Fix" badge
Root Cause
PR #85192 refactored the badge logic but introduced a bug where the "Fix" badge is shown for expenses that have violations but no user-visible errors. The old shouldShowRedBrickRoad() function had different logic that prevented this issue. The new getReasonAndReportActionThatHasRedBrickRoad() function at line 657 of SidebarUtils.ts returns a "Fix" reason whenever hasViolations is true, even when there are no actionable errors visible to the user.
Please re-state the problem that we are trying to solve in this issue.
When a user creates a manual expense with "0" as the amount in a workspace chat, the LHN shows a "Fix" badge on the chat preview, but opening the expense report shows no visible error. The LHN and the report view should be consistent.
What is the root cause of that problem?
The root cause is that getReportActionWithMissingSmartscanFields in ReportUtils.ts passes the chat report (not the expense report) to areRequiredFieldsEmpty when checking transactions inside a REPORTPREVIEW action.
Here is the call chain:
reportAttributes.ts processes the workspace chat report and calls generateReportAttributes({ report: chatReport, ... })
hasSmartscanError → getReportActionWithSmartscanError(chatReportActions, chatReport) finds a REPORTPREVIEW action
For that REPORTPREVIEW: shouldShowRBRForMissingSmartscanFields(chatReport, expenseReportID) → getReportActionWithMissingSmartscanFields(chatReport, expenseReportID) (ReportUtils.ts:5213-5227)
This function iterates the expense report's money request actions but passes the chat report to hasMissingSmartscanFields(transaction, chatReport)
Since the chat report is not an expense report, isFromExpenseReport is false, so the function evaluates (!isFromExpenseReport && getAmount(transaction) === 0) = true for a $0 expense.
This triggers hasSmartscanError → adds a smartscan error to reportErrors → getReasonAndReportActionThatHasRedBrickRoad returns HAS_ERRORS → LHN shows Fix badge.
When the user opens the actual expense report, areRequiredFieldsEmpty is called with the correct expense report, so isFromExpenseReport is true and it only checks isMerchantMissing (not amount===0) — hence no error is shown inside the report.
Note: The "Fix" text badge is only rendered in non-production environments (gated by !isProduction at OptionRowLHN.tsx:164). In production, only the red dot (RBR indicator) would appear, which is why this may appear "not reproducible" in production — the underlying RBR still exists, but the text "Fix" doesn't render.
PR #85523 did not introduce this bug — it only added reactivity for policy field changes. This is a pre-existing issue that was caught during regression testing.
What changes do you think we should make in order to solve the problem?
In getReportActionWithMissingSmartscanFields (ReportUtils.ts:5213-5227), instead of passing the outer report (which is the chat report) to hasMissingSmartscanFieldsTransactionUtils, look up the transaction's actual report using transaction.reportID:
// Before (buggy):
return hasMissingSmartscanFieldsTransactionUtils(transaction, report);
// After (fix):
const transactionReport = getReport(transaction.reportID) ?? report;
return hasMissingSmartscanFieldsTransactionUtils(transaction, transactionReport);
This ensures areRequiredFieldsEmpty receives the correct report type (expense report) and uses the right validation branch (checking merchant instead of amount===0).
What alternative solutions did you explore? (Optional)
An alternative would be to change areRequiredFieldsEmpty to never treat amount===0 as a missing field for manually-created transactions (distinguishing manual entry from smartscan). However, this would be a broader change with more risk. The targeted fix of passing the correct report is simpler and addresses the root cause directly.
Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot <your feedback> to refine this analysis, or explain why you are rejecting Melvin's proposal.
Note: The "Fix" text badge is only rendered in non-production environments (gated by !isProduction at OptionRowLHN.tsx:164). In production, only the red dot (RBR indicator) would appear, which is why this may appear "not reproducible" in production — the underlying RBR still exists, but the text "Fix" doesn't render.
Skipping the payment summary for this issue since all the assignees are employees or vendors. If this is incorrect, please manually add the payment summary SO.
The offending PR is #78570 — "[Part 3]: Remove Onyx.connect() for the key: ONYXKEYS.COLLECTION.REPORT in src/libs/TransactionUtils" by DylanDylann, merged 2026-01-19.
How it introduced the bug
PR #78570 removed a global deprecatedAllReports Onyx connection from TransactionUtils that previously served as a self-correcting fallback in areRequiredFieldsEmpty — it would look up the correct report via transaction.reportID:
When this was replaced with an explicit transactionReport parameter, the entire call chain from getReportActionWithSmartscanError down was updated to accept a report parameter — but the caller (getAllReportActionsErrorsAndReportActionThatRequiresAttention) passes its chat report, not the IOU/expense report that the transaction belongs to:
-function getReportActionWithSmartscanError(reportActions: ReportAction[]): ...+function getReportActionWithSmartscanError(reportActions: ReportAction[], report: OnyxEntry<Report>): ...
...
- shouldShowRBRForMissingSmartscanFields(IOUReportID)+ shouldShowRBRForMissingSmartscanFields(report, IOUReportID) // 'report' is the CHAT report here
This causes isFromExpenseReport to evaluate as false, making (!isFromExpenseReport && getAmount(transaction) === 0) return true for legitimate $0 expenses → incorrect "Fix" badge.
[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.
Activity
melvin-bot commentedon Mar 23, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #85523
melvin-bot commentedon Mar 23, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon Mar 23, 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 Mar 23, 2026
🔍 Investigation Summary
Classification: Frontend bug
Causing PR: #85192 - "feat: deep link to report preview or message that caused GBR/RBR" by @aimane-chnaif (High confidence)
Related Issues: None
Recommendation: REVERT
PR #85192 should be reverted. It refactored the action badge logic and introduced a regression where $0 expenses incorrectly show a "Fix" badge in the LHN even though no error is visible on the report.
Labels: No label changes needed. The issue was initially linked to PR #85523, but that PR only made badges recompute more frequently when policy fields change. The actual bug was introduced by PR #85192 which refactored the red brick road / action badge logic.
📋 Detailed Analysis
Evidence
While PR #85523 was initially suspected (and mentioned in the issue), my investigation revealed that PR #85192 is the actual cause:
PR feat: deep link to report preview or message that caused GBR/RBR #85192 (merged March 18, 2026): Refactored the action badge logic
shouldShowRedBrickRoad()togetReasonAndReportActionThatHasRedBrickRoad()src/libs/actions/OnyxDerived/configs/reportAttributes.tsPR Fix LHN report badge reactivity to policy field changes #85523 (merged March 20, 2026): Added policy field change detection
Verification
I verified this by examining:
actionBadge = CONST.REPORT.ACTION_BADGE.FIXwhenreasonAndReportActionis truthygenerateReportAttributes()callsgetReasonAndReportActionThatHasRedBrickRoad()hasViolationsparameter (line 657 of SidebarUtils.ts)Root Cause
PR #85192 refactored the badge logic but introduced a bug where the "Fix" badge is shown for expenses that have violations but no user-visible errors. The old
shouldShowRedBrickRoad()function had different logic that prevented this issue. The newgetReasonAndReportActionThatHasRedBrickRoad()function at line 657 of SidebarUtils.ts returns a "Fix" reason wheneverhasViolationsis true, even when there are no actionable errors visible to the user.Files affected by PR #85192:
/home/runner/_work/App/App/src/libs/actions/OnyxDerived/configs/reportAttributes.ts/home/runner/_work/App/App/src/libs/SidebarUtils.ts/home/runner/_work/App/App/src/libs/ReportUtils.tsMelvinBot commentedon Mar 23, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When a user creates a manual expense with "0" as the amount in a workspace chat, the LHN shows a "Fix" badge on the chat preview, but opening the expense report shows no visible error. The LHN and the report view should be consistent.
What is the root cause of that problem?
The root cause is that
getReportActionWithMissingSmartscanFieldsinReportUtils.tspasses the chat report (not the expense report) toareRequiredFieldsEmptywhen checking transactions inside a REPORTPREVIEW action.Here is the call chain:
reportAttributes.tsprocesses the workspace chat report and callsgenerateReportAttributes({ report: chatReport, ... })generateReportAttributes→getAllReportErrors(chatReport, chatReportActions)→hasSmartscanError(chatReportActions, chatReport)hasSmartscanError→getReportActionWithSmartscanError(chatReportActions, chatReport)finds a REPORTPREVIEW actionFor that REPORTPREVIEW:
shouldShowRBRForMissingSmartscanFields(chatReport, expenseReportID)→getReportActionWithMissingSmartscanFields(chatReport, expenseReportID)(ReportUtils.ts:5213-5227)This function iterates the expense report's money request actions but passes the chat report to
hasMissingSmartscanFields(transaction, chatReport)Inside
areRequiredFieldsEmpty(TransactionUtils/index.ts:650-652):Since the chat report is not an expense report,
isFromExpenseReportisfalse, so the function evaluates(!isFromExpenseReport && getAmount(transaction) === 0)=truefor a $0 expense.This triggers
hasSmartscanError→ adds a smartscan error toreportErrors→getReasonAndReportActionThatHasRedBrickRoadreturnsHAS_ERRORS→ LHN showsFixbadge.When the user opens the actual expense report,
areRequiredFieldsEmptyis called with the correct expense report, soisFromExpenseReportistrueand it only checksisMerchantMissing(not amount===0) — hence no error is shown inside the report.Note: The "Fix" text badge is only rendered in non-production environments (gated by
!isProductionatOptionRowLHN.tsx:164). In production, only the red dot (RBR indicator) would appear, which is why this may appear "not reproducible" in production — the underlying RBR still exists, but the text "Fix" doesn't render.PR #85523 did not introduce this bug — it only added reactivity for policy field changes. This is a pre-existing issue that was caught during regression testing.
What changes do you think we should make in order to solve the problem?
In
getReportActionWithMissingSmartscanFields(ReportUtils.ts:5213-5227), instead of passing the outerreport(which is the chat report) tohasMissingSmartscanFieldsTransactionUtils, look up the transaction's actual report usingtransaction.reportID:This ensures
areRequiredFieldsEmptyreceives the correct report type (expense report) and uses the right validation branch (checking merchant instead of amount===0).What alternative solutions did you explore? (Optional)
An alternative would be to change
areRequiredFieldsEmptyto never treat amount===0 as a missing field for manually-created transactions (distinguishing manual entry from smartscan). However, this would be a broader change with more risk. The targeted fix of passing the correct report is simpler and addresses the root cause directly.Next Steps for Contributor+ team: Reply with
@MelvinBot implement thisto create a draft PR,@MelvinBot <your feedback>to refine this analysis, or explain why you are rejecting Melvin's proposal.aimane-chnaif commentedon Mar 23, 2026
We can demote this.
grgia commentedon Mar 23, 2026
@aimane-chnaif given we do QA in staging, it seems like we should fix the production check to include staging environment.
I see it was added here #85025
27 remaining items
melvin-bot commentedon Apr 16, 2026
Skipping the payment summary for this issue since all the assignees are employees or vendors. If this is incorrect, please manually add the payment summary SO.
aimane-chnaif commentedon Apr 16, 2026
I am reviewer here
aimane-chnaif commentedon Apr 16, 2026
@MelvinBot please find the offending PR based on your analysis
MelvinBot commentedon Apr 16, 2026
The offending PR is #78570 — "[Part 3]: Remove Onyx.connect() for the key: ONYXKEYS.COLLECTION.REPORT in src/libs/TransactionUtils" by
DylanDylann, merged 2026-01-19.How it introduced the bug
PR #78570 removed a global
deprecatedAllReportsOnyx connection fromTransactionUtilsthat previously served as a self-correcting fallback inareRequiredFieldsEmpty— it would look up the correct report viatransaction.reportID:When this was replaced with an explicit
transactionReportparameter, the entire call chain fromgetReportActionWithSmartscanErrordown was updated to accept areportparameter — but the caller (getAllReportActionsErrorsAndReportActionThatRequiresAttention) passes its chat report, not the IOU/expense report that the transaction belongs to:This causes
isFromExpenseReportto evaluate asfalse, making(!isFromExpenseReport && getAmount(transaction) === 0)returntruefor legitimate $0 expenses → incorrect "Fix" badge.NikkiWines commentedon Apr 17, 2026
@aimane-chnaif do you need assignment here?
aimane-chnaif commentedon Apr 17, 2026
yes please
aimane-chnaif commentedon Apr 17, 2026
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: [Part 3]: Remove Onyx.connect() for the key: ONYXKEYS.COLLECTION.REPORT in src/libs/TransactionUtils #78570 (comment)
[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/625496
Regression Test Proposal
Test:
Do we agree 👍 or 👎
Zapier Logs
Run ID: 00040eee-e5e7-a97b-3637-7c20be2d6c04mallenexpensify commentedon Apr 17, 2026
Payment Summary
Contributor+: @aimane-chnaif paid $250 via Upwork
@aimane-chnaif can you please accept the job below? Please reply here and tag me once you have.
https://www.upwork.com/jobs/~022045189229039204050
aimane-chnaif commentedon Apr 17, 2026
@mallenexpensify I accepted offer
mallenexpensify commentedon Apr 17, 2026
@aimane-chnaif paid, summary updated above. Thx.