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 2025-08-19] [$250] Search - Expense report is displayed as "Deleted report" in Recent chats list #65253
Version Number: 9.1.73-0 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from TestRail:https://expensify.testrail.io/index.php?/tests/view/6406704 Email or phone of affected tester (no customers):sddsoisjndosjo@gmail.com Issue reported by: Applause Internal Team Device used: Mac 15.5 / Chrome App Component: Search
Action Performed:
Precondition:
Disable all the features in Workflows.
Admin invites member to the workspace.
Go to staging.new.expensify.com
[Member] Go to workspace chat.
[Member] Submit an expense to the workspace chat.
[Admin] Click search icon on the top right.
Expected Result:
Expense report will show the report title in Recent chats list.
Actual Result:
Expense report is displayed as "Deleted report" in Recent chats list.
The title of expense report is generate wrong by the below function since transactions value at the time it is triggered is not up to date. Therefore, it returns Deleted report
What changes do you think we should make in order to solve the problem?
We need to add transactions value as dependency of the useEffect that handle reports changes and then pass down to the function isClosedExpenseReportWithNoExpenses where the bug occurs.
The transactions value should be from the parent component instead of using Onyx.connect. Here is how we get the transactions value
Also we need to update the hook to get option list value, we should update the function shallowOptionsListCompare to have deep compare, so that the recent chats list component can re-render to show latest display value of report
* optionsList reference can change multiple times even the value of its arrays is the same. We perform shallow comparison to check if the options have truly changed.
* This is necessary to avoid unnecessary re-renders in components that use this context.
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
NA
What alternative solutions did you explore? (Optional)
NA
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.
🚨 Edited by proposal-police: This proposal was edited at 2025-07-21 12:06:12 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Search - Expense report is displayed as "Deleted report" in Recent chats list
What is the root cause of that problem?
The first time, focus on the browser tap and click on search, the newest transaction is not loaded yet. inside getReportNameInternal function, this condition is true.
We can get the length of transactions and add it as a dependency to the above useEffect. So when a new transaction is added, the recent options are updated as well.
If the search list is already open, it still shows the Deleted Report. Therefore, we need to check both the report text and reportID in the shallowOptionsListCompare function.
changed the title [-][$250] Search - Expense report is displayed as "Deleted report" in Recent chats list[/-][+][Due for payment 2025-08-19] [$250] Search - Expense report is displayed as "Deleted report" in Recent chats list[/+]on Aug 12, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.92-5 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@alitoshmatov@dylanexpensify The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero 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]
1a. Result of the original design (eg. a case wasn't considered)
1b. Mistake during implementation
1c. Backend bug
1z. Other:
Where bug was reported:
2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
2b. Reported on staging (eg. found during regression or PR testing)
2d. Reported on a PR
2z. Other:
Who reported the bug:
3a. Expensify user
3b. Expensify employee
3c. Contributor
3d. QA
3z. Other:
[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: Couldn't pinpoint exact PR since it was hard to catch, transactions dependency technically wasn't required for that useEffect
[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: No discussion was started
[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.
I don't think this requires regression, very edge case.
Activity
melvin-bot commentedon Jul 1, 2025
Triggered auto assignment to @dylanexpensify (
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.dylanexpensify commentedon Jul 2, 2025
reviewing!
thelullabyy commentedon Jul 2, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
Expense report is displayed as "Deleted report" in Recent chats list.
What is the root cause of that problem?
Here is the place that we generate recent chats list
App/src/components/OptionListContextProvider.tsx
Lines 135 to 165 in 8f93ecd
The title of expense report is generate wrong by the below function since
transactionsvalue at the time it is triggered is not up to date. Therefore, it returnsDeleted reportApp/src/libs/ReportUtils.ts
Line 2038 in 03de9b1
What changes do you think we should make in order to solve the problem?
We need to add
transactionsvalue as dependency of theuseEffectthat handle reports changes and then pass down to the functionisClosedExpenseReportWithNoExpenseswhere the bug occurs.The
transactionsvalue should be from the parent component instead of usingOnyx.connect. Here is how we get thetransactionsvalueApp/src/components/OptionListContextProvider.tsx
Line 165 in 8f93ecd
Also we need to update the hook to get option list value, we should update the function
shallowOptionsListCompareto have deep compare, so that the recent chats list component can re-render to show latest display value of reportApp/src/components/OptionListContextProvider.tsx
Lines 270 to 286 in 8f93ecd
App/src/libs/OptionsListUtils.ts
Lines 2578 to 2581 in b1658e2
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
NA
What alternative solutions did you explore? (Optional)
NA
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.
nabi-ebrahimi commentedon Jul 3, 2025
🚨 Edited by proposal-police: This proposal was edited at 2025-07-21 12:06:12 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Search - Expense report is displayed as "Deleted report" in Recent chats list
What is the root cause of that problem?
The first time, focus on the browser tap and click on search, the newest transaction is not loaded yet. inside
getReportNameInternalfunction, this condition is true.App/src/libs/ReportUtils.ts
Lines 5225 to 5227 in 11ff1d3
Because the transaction with the specified reportID is not loaded yet. so
hasExpensesreturnfalseApp/src/libs/ReportUtils.ts
Lines 2021 to 2036 in 11ff1d3
So, it shows
Deleted ReportWhat changes do you think we should make in order to solve the problem?
We should update the recentOptionList when a new transaction is loaded.
App/src/components/OptionListContextProvider.tsx
Lines 135 to 165 in 11ff1d3
We can get the length of transactions and add it as a dependency to the above
useEffect. So when a new transaction is added, the recent options are updated as well.If the search list is already open, it still shows the
Deleted Report. Therefore, we need to check both the reporttextandreportIDin theshallowOptionsListComparefunction.App/src/libs/OptionsListUtils.ts
Lines 2578 to 2581 in b1658e2
update to this
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
None
What alternative solutions did you explore? (Optional)
Demo
searched-compressed-record.mp4
melvin-bot commentedon Jul 7, 2025
@dylanexpensify Eep! 4 days overdue now. Issues have feelings too...
dylanexpensify commentedon Jul 9, 2025
Confirming behavior internally
dylanexpensify commentedon Jul 11, 2025
posted to confirm
31 remaining items
[-][$250] Search - Expense report is displayed as "Deleted report" in Recent chats list[/-][+][Due for payment 2025-08-19] [$250] Search - Expense report is displayed as "Deleted report" in Recent chats list[/+]melvin-bot commentedon Aug 12, 2025
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Aug 12, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.92-5 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 2025-08-19. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Aug 12, 2025
@alitoshmatov @dylanexpensify The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero 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]
dylanexpensify commentedon Aug 18, 2025
Tomorrow!
alitoshmatov commentedon Aug 18, 2025
BugZero Checklist:
Bug classification
Source of bug:
Where bug was reported:
Who reported the bug:
[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: Couldn't pinpoint exact PR since it was hard to catch,
transactionsdependency technically wasn't required for thatuseEffect[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: No discussion was started
[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.
I don't think this requires regression, very edge case.
dylanexpensify commentedon Aug 19, 2025
Payment summary:
Contributor: @thelullabyy $250 via Upwork
Contributor+: @alitoshmatov $250 via NewDot
Please apply/request!
garrettmknight commentedon Aug 20, 2025
$250 approved for @alitoshmatov