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] Reports - Violations are not visible on expense preview on "Top Spenders" section. #79256
Version Number: 9.2.97-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:#78410 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) - Windows 11 / Chrome App Component: Search
Action Performed:
Prerequisite: Account has at least one workspace.
Open the Expensify app.
Open any workspace chat.
Create a manual expense with date from last month.
Navigate to "Reports" > "Top Spenders"
Expand the results.
Long tap and select the just created expense.
Tap on dropdown menu and select "Hold"
Enter any reason and hold the expense.
Note that after expense is held, no message is visible on expense preview.
Open the expense.
Note that expense is correctly held.
Return to "Top Spenders"
Note that violation message is still not visible.
Expected Result:
Violations should be visible on preview of expenses while on "Top Spenders" section.
Actual Result:
After holding an expense while on "Top Spenders" section, no violation message appears on preview. Same behaviour is experienced in "Unapproved Cash" section.
Since these expanded transactions aren't in searchResults.data, their violations are excluded from filteredViolations
What changes do you think we should make in order to solve the problem?
Skip the pre-filtering of violations when the search is grouped (i.e., when validGroupBy is set). For grouped searches like Top Spenders, pass the raw violations collection instead of filteredViolations
constvalidGroupBy=groupBy&&Object.values(CONST.SEARCH.GROUP_BY).includes(groupBy) ? groupBy : undefined;constfilteredViolations=useMemo(()=>{// For grouped searches, skip pre-filtering since expanded groups load data from separate snapshotsif(validGroupBy){returnviolations;}if(!violations||!searchResults?.data){returnviolations;}
...
changed the title [-]Reports - Violations are not visible on expense preview on "Top Spenders" section.[/-][+][$250] Reports - Violations are not visible on expense preview on "Top Spenders" section.[/+]on Jan 10, 2026
Please re-state the problem that we are trying to solve in this issue.
Violations are not visible on expense previews in the "Top Spenders" section. After holding an expense while viewing grouped search results, the violation message does not appear on the expense preview.
What is the root cause of that problem?
In Search/index.tsx, filteredViolations is computed by iterating only through transactions in searchResults.data:
index.tsx
Lines 253-287
// Filter violations based on user visibilityconstfilteredViolations=useMemo(()=>{if(!violations||!searchResults?.data){returnviolations;}constfiltered: Record<string,TransactionViolation[]>={};consttransactionKeys=Object.keys(searchResults.data).filter((key)=>key.startsWith(ONYXKEYS.COLLECTION.TRANSACTION),);for(constkeyoftransactionKeys){// eslint-disable-next-line @typescript-eslint/no-deprecatedconsttransaction=searchResults.data[keyaskeyoftypeofsearchResults.data]asSearchTransaction;if(!transaction||typeoftransaction!=='object'||!('transactionID'intransaction)||!('reportID'intransaction)){continue;}constreport=searchResults.data[`${ONYXKEYS.COLLECTION.REPORT}${transaction.reportID}`];constpolicy=searchResults.data[`${ONYXKEYS.COLLECTION.POLICY}${report?.policyID}`];if(report&&policy){consttransactionViolations=violations[`${ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS}${transaction.transactionID}`];if(transactionViolations){constfilteredTransactionViolations=mergeProhibitedViolations(transactionViolations.filter((violation)=>shouldShowViolation(report,policy,violation.name,email??'',true,transaction,),),);if(filteredTransactionViolations.length>0){filtered[`${ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS}${transaction.transactionID}`]=filteredTransactionViolations;}}}}returnfiltered;},[violations,searchResults,email]);
When a group is expanded, TransactionGroupListItem loads transactions from a separate transactionsSnapshot Onyx collection (line 95), but TransactionGroupListExpanded receives filteredViolations which only contains violations for transactions in searchResults.data. As a result, violations for transactions loaded from the snapshot are missing.
What changes do you think we should make in order to solve the problem?
For grouped searches, skip pre-filtering in Search/index.tsx and pass raw violations. Update TransactionGroupListExpanded to filter violations per transaction using shouldShowViolation, matching the pattern in TransactionListItem.
Change 1: Modify filteredViolations computation in Search/index.tsx:
// Filter violations based on user visibilityconstfilteredViolations=useMemo(()=>{// For grouped searches, skip pre-filtering since expanded groups load data from separate snapshotsif(validGroupBy){returnviolations;}if(!violations||!searchResults?.data){returnviolations;}constfiltered: Record<string,TransactionViolation[]>={};consttransactionKeys=Object.keys(searchResults.data).filter((key)=>key.startsWith(ONYXKEYS.COLLECTION.TRANSACTION),);for(constkeyoftransactionKeys){// eslint-disable-next-line @typescript-eslint/no-deprecatedconsttransaction=searchResults.data[keyaskeyoftypeofsearchResults.data]asSearchTransaction;if(!transaction||typeoftransaction!=='object'||!('transactionID'intransaction)||!('reportID'intransaction)){continue;}constreport=searchResults.data[`${ONYXKEYS.COLLECTION.REPORT}${transaction.reportID}`];constpolicy=searchResults.data[`${ONYXKEYS.COLLECTION.POLICY}${report?.policyID}`];if(report&&policy){consttransactionViolations=violations[`${ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS}${transaction.transactionID}`];if(transactionViolations){constfilteredTransactionViolations=mergeProhibitedViolations(transactionViolations.filter((violation)=>shouldShowViolation(report,policy,violation.name,email??'',true,transaction,),),);if(filteredTransactionViolations.length>0){filtered[`${ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS}${transaction.transactionID}`]=filteredTransactionViolations;}}}}returnfiltered;},[violations,searchResults,email,validGroupBy]);
Change 2: Add imports and update violation filtering in TransactionGroupListExpanded.tsx:
This uses the report and policy already attached to each transaction from snapshot data (via getSections), matching the pattern used in TransactionListItem (lines 121-127), ensuring violations are filtered correctly for both main search results and expanded snapshot transactions.
What alternative solutions did you explore? (Optional)
, violations are only retrieved for transactions present in the current search results.
However, in the "Top Spenders" view, the current search result does not include transactions or violation data. Instead, transaction and violation data are sourced from a different snapshot:
As a result, violations are not shown for transactions in the "Top Spenders" or "Unapproved Cash" sections because they rely on data that isn't part of the main search result payload.
What changes do you think we should make in order to solve the problem?
In TransactionItemRow, we should re-calculate violation data when the violations prop is empty.
This fallback ensures that violation info is still rendered using available data from the transaction itself, even when it isn’t present in the passed violations object.
⚠️@truph01 Your proposal is a duplicate of an already existing proposal and has been automatically withdrawn to prevent spam. Please review the existing proposals before submitting a new one.
Please re-state the problem that we are trying to solve in this issue.
After holding an expense while on "Top Spenders" section, no violation message appears on preview. Same behaviour is experienced in "Unapproved Cash" section.
What is the root cause of that problem?
For group-by filter, the transaction violation data is in the snapshot of each group instead of the search query snapshot then no violation appears.
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
CC @Julesssss to confirm whether we can still proceed with payment summary?
Hi @brianlee-expensify, ah yes we had an issue with deploys but this was resolved in a later release (we just don't send the automated fix in this case). So you're good to pay out here
Activity
melvin-bot commentedon Jan 9, 2026
Triggered auto assignment to @brianlee-expensify (
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.nyomanjyotisa commentedon Jan 9, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
Reports - Violations are not visible on expense preview on "Top Spenders" section.
What is the root cause of that problem?
In the Search component,
filteredViolationsis computed by iterating only through transactions insearchResults.dataApp/src/components/Search/index.tsx
Lines 263 to 273 in fd10aa2
But when a group is expanded,
TransactionGroupListItemloads transactions from a separatetransactionsSnapshotOnyx collectionApp/src/components/SelectionListWithSections/Search/TransactionGroupListItem.tsx
Line 96 in fd10aa2
App/src/components/SelectionListWithSections/Search/TransactionGroupListItem.tsx
Lines 107 to 112 in fd10aa2
Since these expanded transactions aren't in
searchResults.data, their violations are excluded fromfilteredViolationsWhat changes do you think we should make in order to solve the problem?
Skip the pre-filtering of violations when the search is grouped (i.e., when
validGroupByis set). For grouped searches like Top Spenders, pass the rawviolationscollection instead offilteredViolationsApp/src/components/Search/index.tsx
Lines 255 to 289 in fd10aa2
What alternative solutions did you explore? (Optional)
None
[-]Reports - Violations are not visible on expense preview on "Top Spenders" section.[/-][+][$250] Reports - Violations are not visible on expense preview on "Top Spenders" section.[/+]melvin-bot commentedon Jan 10, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022009792744841457091
melvin-bot commentedon Jan 10, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @akinwale (
External)yatin-italy commentedon Jan 10, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
Violations are not visible on expense previews in the "Top Spenders" section. After holding an expense while viewing grouped search results, the violation message does not appear on the expense preview.
What is the root cause of that problem?
In Search/index.tsx, filteredViolations is computed by iterating only through transactions in searchResults.data:
index.tsx
Lines 253-287
When a group is expanded, TransactionGroupListItem loads transactions from a separate transactionsSnapshot Onyx collection (line 95), but TransactionGroupListExpanded receives filteredViolations which only contains violations for transactions in searchResults.data. As a result, violations for transactions loaded from the snapshot are missing.
What changes do you think we should make in order to solve the problem?
For grouped searches, skip pre-filtering in Search/index.tsx and pass raw violations. Update TransactionGroupListExpanded to filter violations per transaction using shouldShowViolation, matching the pattern in TransactionListItem.
Change 1: Modify filteredViolations computation in Search/index.tsx:
Change 2: Add imports and update violation filtering in TransactionGroupListExpanded.tsx:
This uses the report and policy already attached to each transaction from snapshot data (via getSections), matching the pattern used in TransactionListItem (lines 121-127), ensuring violations are filtered correctly for both main search results and expanded snapshot transactions.
What alternative solutions did you explore? (Optional)
None
truph01 commentedon Jan 10, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
What is the root cause of that problem?
In the logic used to fetch violation data
App/src/components/Search/index.tsx
Line 256 in 073940f
However, in the "Top Spenders" view, the current search result does not include transactions or violation data. Instead, transaction and violation data are sourced from a different snapshot:
App/src/components/SelectionListWithSections/Search/TransactionGroupListItem.tsx
Line 96 in fd10aa2
As a result, violations are not shown for transactions in the "Top Spenders" or "Unapproved Cash" sections because they rely on data that isn't part of the main search result payload.
What changes do you think we should make in order to solve the problem?
In
TransactionItemRow, we should re-calculate violation data when theviolationsprop is empty.This fallback ensures that violation info is still rendered using available data from the transaction itself, even when it isn’t present in the passed
violationsobject.violationswithmergedViolationsin here and hereWhat alternative solutions did you explore? (Optional)
github-actions commentedon Jan 10, 2026
nkdengineer commentedon Jan 10, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
After holding an expense while on "Top Spenders" section, no violation message appears on preview. Same behaviour is experienced in "Unapproved Cash" section.
What is the root cause of that problem?
For group-by filter, the transaction violation data is in the snapshot of each group instead of the search query snapshot then no violation appears.
App/src/components/SelectionListWithSections/Search/TransactionGroupListItem.tsx
Line 374 in 183c181
What changes do you think we should make in order to solve the problem?
We should get the violations from snapshot of each group. The logic is the same here
App/src/components/SelectionListWithSections/Search/TransactionGroupListItem.tsx
Line 374 in 183c181
And then pass the result as violations prop here
What alternative solutions did you explore? (Optional)
Since we returned the
violationsfor each transaction item, we can usetransactionItem.violationshereAnd we need to filter out the visibility violation for the current user here by using
shouldShowViolationfunctionApp/src/libs/SearchUIUtils.ts
Line 1346 in 183c181
App/src/libs/SearchUIUtils.ts
Line 1301 in 183c181
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
18 remaining items
nkdengineer commentedon Jan 21, 2026
@akinwale The PR is ready for review.
mvtglobally commentedon Jan 24, 2026
Issue not reproducible during KI retests. (First week)
akinwale commentedon Feb 13, 2026
@brianlee-expensify Deployed to production on 2025-02-05. Payment due 2025-02-12.
JmillsExpensify commentedon Feb 13, 2026
Agree with Puneet. We should be showing them.
brianlee-expensify commentedon Feb 13, 2026
@akinwale i noticed that the deploy to prod failed for iOS (see here)
CC @Julesssss to confirm whether we can still proceed with payment summary?
Julesssss commentedon Feb 13, 2026
Hi @brianlee-expensify, ah yes we had an issue with deploys but this was resolved in a later release (we just don't send the automated fix in this case). So you're good to pay out here
brianlee-expensify commentedon Feb 13, 2026
Payment Summary
Contributor: @nkdengineer due $250 via NewDot
Contributor+: @akinwale due $250 via NewDot
quinthar commentedon Feb 23, 2026
Approved $250 to @akinwale
twisterdotcom commentedon Feb 25, 2026
@nkdengineer has submitted payment for this report on ND here.
SO: https://stackoverflowteams.com/c/expensify/questions/7582
Zapier Logs
Run ID: 00040eee-c18e-a267-b3a4-9cb6fb5904f4