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-04-07] [$250] Reports - "To" field does not show recipient after submitting track expense to other user #57733
Version Number: 9.1.8-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: Exp Email or phone of affected tester (no customers):applausetester+ps309@applause.expensifail.com Issue reported by: Applause Internal Team Device used: Mac 15.3 / Chrome App Component: Search
Action Performed:
Precondition:
Account has self DM.
Go to staging.new.expensify.com
Go to self DM.
Track a manual expense.
Go to Reports.
Click on the track expense in Step 3.
Click on the report header.
Click Submit it to someone.
Select a user.
On the confirmation page, enter a merchant.
Submit the expense.
Expected Result:
"To" field will update and display the recipient after submitting the expense.
Actual Result:
Merchant field is updated, but "To" field stills display the current user instead of recipient.
It only updates and displays the recipient after switching report status or refreshing the page.
🚨 Edited by proposal-police: This proposal was edited at 2025-03-10 16:20:00 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Merchant field is updated, but "To" field stills display the current user instead of recipient.
It only updates and displays the recipient after switching report status or refreshing the page.
What is the root cause of that problem?
We have the logic to retrigger the Search API to update the latest data whenever there're new transactions or report actions if the query type is expense or chat respectively.
But when you convert the track expense, new report actions will be created while no new transactions will, and as the query type is currently expense, the above logic will not trigger.
❓One another question: Why is the merchant or category updated, but not to?
We have the logic here to update the snapshot data based on original data. For example, a normal transactions_123 update would also update snapshot_abc.data.transactions_123. Note that this only update whichever keys are in the transactions_123. For example, the merchant key exists in transactions type so its value would definitely be updated in snapshot.
However, in this case, the managerID key exists in snapshot data but not in transactions type. The managerID key is only evaluated and returned by the BE's Search API. So it would NOT be updated to snapshot by updateSnapshots function. And this key is used to display the receiver (to) field.
What changes do you think we should make in order to solve the problem?
We can remove the query type check isChat.
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
Update the useSearchHighlightAndScrollTest to make Search call independent of query type.
What alternative solutions did you explore? (Optional)
changed the title [-]Reports - "To" field does not show recipient after submitting track expense to other user[/-][+][$250] Reports - "To" field does not show recipient after submitting track expense to other user[/+]on Mar 4, 2025
@mkzie2 Thanks for the proposal! But could you please elaborate more on why we added isChat query type check and why it's not needed now, so we can remove it accordingly?
@jayeshmangwani That was added in #53482 just as an optimization given the dependency between the update type and query type (i.e. reportActions updates are coupled with chat query type while transactions ones are coupled with the rest). But now we can see that dependency might not be correct in this specific case (convert track expense). There's no drawback of removing the isChat check as fas as I've tested.
changed the title [-][$250] Reports - "To" field does not show recipient after submitting track expense to other user[/-][+][Due for payment 2025-04-07] [$250] Reports - "To" field does not show recipient after submitting track expense to other user[/+]on Mar 31, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.20-2 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@jayeshmangwani@sakluger@jayeshmangwani 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]
[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: N/A
[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
Preconditions:
Ensure the account has a self-DM.
Navigate to your self-DM.
Track a manual expense.
Go to the Reports tab.
Click on the tracked expense from Step 2.
Click on the report header.
Select Submit it to someone.
Choose a user to submit the expense to.
On the confirmation page, enter a merchant.
Submit the expense.
Go to the Search page and verify that the To field has been updated.
Activity
melvin-bot commentedon Mar 4, 2025
Triggered auto assignment to @sakluger (
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.mkzie2 commentedon Mar 4, 2025
🚨 Edited by proposal-police: This proposal was edited at 2025-03-10 16:20:00 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Merchant field is updated, but "To" field stills display the current user instead of recipient.
It only updates and displays the recipient after switching report status or refreshing the page.
What is the root cause of that problem?
We have the logic to retrigger the
SearchAPI to update the latest data whenever there're new transactions or report actions if the query type isexpenseorchatrespectively.App/src/hooks/useSearchHighlightAndScroll.ts
Lines 55 to 56 in d04b29b
App/src/hooks/useSearchHighlightAndScroll.ts
Lines 65 to 66 in d04b29b
But when you convert the track expense, new report actions will be created while no new transactions will, and as the query type is currently
expense, the above logic will not trigger.❓One another question: Why is the
merchantorcategoryupdated, but notto?We have the logic here to update the
snapshotdata based on original data. For example, a normaltransactions_123update would also updatesnapshot_abc.data.transactions_123. Note that this only update whichever keys are in thetransactions_123. For example, themerchantkey exists intransactionstype so its value would definitely be updated insnapshot.However, in this case, the
managerIDkey exists insnapshotdata but not intransactionstype. ThemanagerIDkey is only evaluated and returned by the BE'sSearchAPI. So it would NOT be updated tosnapshotbyupdateSnapshotsfunction. And this key is used to display the receiver (to) field.What changes do you think we should make in order to solve the problem?
We can remove the query type check
isChat.What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
Update the
useSearchHighlightAndScrollTestto makeSearchcall independent of query type.What alternative solutions did you explore? (Optional)
NA
[-]Reports - "To" field does not show recipient after submitting track expense to other user[/-][+][$250] Reports - "To" field does not show recipient after submitting track expense to other user[/+]melvin-bot commentedon Mar 4, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021896958133996103336
melvin-bot commentedon Mar 4, 2025
Triggered auto assignment to Contributor-plus team member for initial proposal review - @jayeshmangwani (
External)jayeshmangwani commentedon Mar 5, 2025
@mkzie2 Thanks for the proposal! But could you please elaborate more on why we added
isChatquery type check and why it's not needed now, so we can remove it accordingly?mkzie2 commentedon Mar 6, 2025
@jayeshmangwani That was added in #53482 just as an optimization given the dependency between the update type and query type (i.e.
reportActionsupdates are coupled withchatquery type whiletransactionsones are coupled with the rest). But now we can see that dependency might not be correct in this specific case (convert track expense). There's no drawback of removing theisChatcheck as fas as I've tested.27 remaining items
[-][$250] Reports - "To" field does not show recipient after submitting track expense to other user[/-][+][Due for payment 2025-04-07] [$250] Reports - "To" field does not show recipient after submitting track expense to other user[/+]melvin-bot commentedon Mar 31, 2025
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Mar 31, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.20-2 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-04-07. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Mar 31, 2025
@jayeshmangwani @sakluger @jayeshmangwani 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]
jayeshmangwani commentedon Apr 7, 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: Fix - Web - Search - New messages are not updated automatically in chats section #53482 (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: N/A
[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
Preconditions:
Do we agree 👍 or 👎
sakluger commentedon Apr 7, 2025
Summarizing payment on this issue:
Contributor: @mkzie2 $250, paid via Upwork
Contributor+: @jayeshmangwani $250, please request on Newdot
garrettmknight commentedon Apr 10, 2025
$250 approved for @jayeshmangwani
QichenZhu commentedon Aug 25, 2026
This is related to issue #98048, which was fixed by PRs #98558 and #98752. See details here.