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-07-14] [$250] Reports - After deleting expense and returning to "Chats" messages display fallback avatar. #63300
Version Number: 9.1.56-1 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from TestRail: N/A Email or phone of affected tester (no customers):ibellicotest+948@gmail.com Issue reported by: Applause Internal Team Device used: Motorola MotoG60 - Android 12 - Chrome / Windows 10 - Chrome App Component: Search
Action Performed:
Prerequisite: Account has at least one workspace available.
Prerequisite 2: No expenses created yet.
Open the Expensify app.
Open any workspace chat.
Submit a manual expense.
Navigate to "Reports"
Tap on the bookmark icon and select "Chats"
Note that all the messages display the correct avatat.
Tap on bookmark icon again and select "Expenses"
Long tap on the just created expense and select it.
Delete the expense.
After the expense disappears, use device´s back button to return to "Chats"
Note that now, all the messages display fallback avatar.
Expected Result:
All the messages on "Chats" section, should display the correct avatar in every moment.
Actual Result:
After deleting an expense on "Expenses" section and returning to "Chats" using the device´s back button, all the messages are displayed with fallback avatar.
However, after coming back from the empty expense report, the value is undefined. The value is retrieved from the onyx snapshot data, based on the current search hash.
This means that when switching between tabs (because a new search component is added), or updating the filter. However, when we navigate back using the browser/device back button, we simply pop the current search component and go back to the previous component. This doesn't trigger the above useEffect. So, the current search hash still hold the previous search hash, and since the previous search is an empty expense report, the personal details list is empty too.
What changes do you think we should make in order to solve the problem?
We need to update the search hash every time the screen changes, too. The simplest way to do this is to use a useFocusEffect.
Please re-state the problem that we are trying to solve in this issue.
After deleting an expense on "Expenses" section and returning to "Chats" using the device´s back button, all the messages are displayed with fallback avatar.
Note: If we just only update the hash, the Search API will be triggered again with the previous type (expense)
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)
N/A 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.
changed the title [-]Reports - After deleting expense and returning to "Chats" messages display fallback avatar.[/-][+][$250] Reports - After deleting expense and returning to "Chats" messages display fallback avatar.[/+]on Jun 12, 2025
@c3024@zanyrenney 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]
Popping in here quick - In the proposal template we ask
What is the root cause of that problem?
What changes do you think we should make in order to solve the problem?
We want to focus on the root cause and solution to fix that. It's possible that improvements are made as part of the initial PR or additional PRs but... we should stick with focusing on the solution specific to the root cause and follow this from CONTRIBUTING.md .
Note: Before submitting a proposal on an issue, be sure to read any other existing proposals. ALL NEW PROPOSALS MUST BE DIFFERENT FROM EXISTING PROPOSALS. The difference should be important, meaningful or considerable.
So.. for this, it looks/sounds like we should move forward with @bernhardoj 's proposal and PR. It also sounds like @nkdengineer 's proposed improvements are valuable so we should create an issue for that and assign both @c3024 and @nkdengineer there. @cristipaval , can you do that? (I haven't been following this issue and am unsure of the exact deliverable or steps).
[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: Not a critical regression to start a 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.
Regression Test Proposal Template
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue:
Regression Test Proposal
Precondition:
None
Test:
Create a new account
Create a new workspace
Open Reports
Switch to Chat > Reports
Press browser or device back button
Verify the chat list items show the avatar correctly
Activity
melvin-bot commentedon Jun 3, 2025
Triggered auto assignment to @zanyrenney (
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.bernhardoj commentedon Jun 3, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
It's not that after deleting expense, but after going from the empty expense tab back to the Chats tab, the avatar is shown with a fallback image.
What is the root cause of that problem?
The avatar is taken from the personal detail list collection.
App/src/pages/home/report/ReportActionItemSingle.tsx
Line 124 in 4142c94
However, after coming back from the empty expense report, the value is undefined. The value is retrieved from the onyx snapshot data, based on the current search hash.
App/src/hooks/useOnyx.ts
Lines 48 to 49 in 4142c94
The current search hash is updated every time the
hashis updated.App/src/components/Search/index.tsx
Lines 180 to 183 in 4142c94
This means that when switching between tabs (because a new search component is added), or updating the filter. However, when we navigate back using the browser/device back button, we simply pop the current search component and go back to the previous component. This doesn't trigger the above useEffect. So, the current search hash still hold the previous search hash, and since the previous search is an empty expense report, the personal details list is empty too.
What changes do you think we should make in order to solve the problem?
We need to update the search hash every time the screen changes, too. The simplest way to do this is to use a
useFocusEffect.(we can update
setCurrentSearchHashto ignore the call if the current search hash is the same as the passed hash)And since we update the current search hash, this useEffect is now triggered because
clearSelectedTransactionsdepends oncurrentSearchHash.App/src/components/Search/index.tsx
Lines 180 to 183 in 4142c94
To simplify this, we can move the
useEffectlogic into theuseFocusEffect.What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
N/A
nkdengineer commentedon Jun 3, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
After deleting an expense on "Expenses" section and returning to "Chats" using the device´s back button, all the messages are displayed with fallback avatar.
What is the root cause of that problem?
There're 2 issues:
1. Snapshot is not updated correctly
We're getting the
personalDetailsfrom snapshotApp/src/pages/home/report/ReportActionItemSingle.tsx
Line 108 in 4142c94
and it's updated whenever we call
SearchAPI. For now we have 2 type of Search API:expenseandchat.expensewill be called here when users open Expenses or Reports pageschatwill be called here when users open Chat pagesBut in this case, if users open Chat page by using browser back button, this logic is not triggered since it's still in the stack and isn't unmounted.
So the snapshot is not updated as usual
In conclusion, hash and snapshot are not updated when users back to Chat page
What changes do you think we should make in order to solve the problem?
Note: If we just only update the hash, the Search API will be triggered again with the previous type (expense)
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)
N/A
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.
melvin-bot commentedon Jun 6, 2025
@zanyrenney Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
melvin-bot commentedon Jun 10, 2025
@zanyrenney 6 days overdue. This is scarier than being forced to listen to Vogon poetry!
melvin-bot commentedon Jun 12, 2025
@zanyrenney 8 days overdue is a lot. Should this be a Weekly issue? If so, feel free to change it!
[-]Reports - After deleting expense and returning to "Chats" messages display fallback avatar.[/-][+][$250] Reports - After deleting expense and returning to "Chats" messages display fallback avatar.[/+]zanyrenney commentedon Jun 12, 2025
weird, why did this not assign a c+...
67 remaining items
melvin-bot commentedon Jul 7, 2025
@c3024 @zanyrenney 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]
mallenexpensify commentedon Jul 7, 2025
Popping in here quick - In the proposal template we ask
We want to focus on the root cause and solution to fix that. It's possible that improvements are made as part of the initial PR or additional PRs but... we should stick with focusing on the solution specific to the root cause and follow this from CONTRIBUTING.md .
So.. for this, it looks/sounds like we should move forward with @bernhardoj 's proposal and PR. It also sounds like @nkdengineer 's proposed improvements are valuable so we should create an issue for that and assign both @c3024 and @nkdengineer there. @cristipaval , can you do that? (I haven't been following this issue and am unsure of the exact deliverable or steps).
mallenexpensify commentedon Jul 14, 2025
Contributor: @bernhardoj due $250 via NewDot
Contributor+: @c3024 due $250 via NewDot
@c3024 plz complete the BZ checklist.
melvin-bot commentedon Jul 14, 2025
Payment Summary
Upwork Job
BugZero Checklist (@mallenexpensify)
bernhardoj commentedon Jul 14, 2025
Requested in ND.
JmillsExpensify commentedon Jul 14, 2025
$250 approved for @bernhardoj
zanyrenney commentedon Jul 15, 2025
@c3024 please complete the checklist?
c3024 commentedon Jul 15, 2025
I'll complete it today. Thanks for the bump!
c3024 commentedon Jul 16, 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: https://github.com/Expensify/App/pull/46406/files#r2210526020
[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: Not a critical regression to start a 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.
Regression Test Proposal Template
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue:
Regression Test Proposal
Precondition:
Test:
Do we agree 👍 or 👎
zanyrenney commentedon Jul 17, 2025
Payments
Reviewer: @bernhardoj owed $250 via NewDot - PAID
Reviewer: @c3024 owed $250 via NewDot - Please request on ND.
twisterdotcom commentedon Jul 28, 2025
@c3024 has submitted payment for this report on ND here.
SO: https://stackoverflowteams.com/c/expensify/questions/7582
Zapier Logs
Run ID: 00040eee-4a60-a92d-a0b5-01713afa5d81