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
[HOLD for payment 2025-01-02] [$250] Search - App redirects to DM when submitting expense in Search after deleting expense #52477
**Version Number:**9.0.61-0 Reproducible in staging?: Y Reproducible in production?: Y Email or phone of affected tester (no customers):applausetester+odijd0349@applause.expensifail.com Issue reported by: Applause Internal Team
Action Performed:
Go to staging.new.expensify.com
Open DM with any user.
Submit an expense to the user.
Go to Search.
Select the expense via checkbox.
Click on the dropdown > Delete expense.
Delete the expense.
Open FAB while stay on Search page.
Click Submit expense under Quick action.
Enter amount and submit it.
Note that app redirects to DM with the user.
Go to Search page.
Open FAB > Click Submit expense under Quick action.
Enter amount and submit it.
Note that app stays in Search page in this case (expected result).
Expected Result:
In Step 11, app should remain in Search page when submitting expense to user after deleting an expense in Search.
Actual Result:
In Step 11, app redirects to DM when submitting expense to user after deleting an expense in Search.
This issue also happens with Submit expense option in FAB, and only happens when an expense is deleted in Search and submitting another expense.
Edited by proposal-police: This proposal was edited at 2024-11-13 14:46:43 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Search - App redirects to DM when submitting expense in Search after deleting expense
To reproduce:
Make sure you have an empty chat with someone (by creating an expense and deleting it so that it will appear in quick action menu in FAB)
then open search and create the expense from Quick action menu
What is the root cause of that problem?
When we notifyNewAction when creating the expense scrollToBottomForCurrentUserAction is called and if the lastVisibleActionCreated timestamp differs from the lastAction.created, which would mean the report action list doesn't have newest report action, we navigate to the report so as to fetch the newest report action by triggering openReport
Although we correctly update the lastVisibleActionCreated and lastAction this code is executed too quickly and by that time we don't have the correct updated values for both. So if we had any report action in the report then both values would be the same old values but as they will be equal this navigate code is not called (that's why we don't reproduce it on non-empty chats) but if we have a empty report before creating the expense the lastVisibleActionCreated will have a different value than the lastAction.created which is the created action.
BTW this navigate code is unnecessarily being called even when you submit expense from the report screen, the effect only became visible for this current issue because we were in search page.
What changes do you think we should make in order to solve the problem?
We need to give it a time before scrollToBottomForCurrentUserAction is called so that we calculate according to the correct values of lastVisibleActionCreated and lastAction are populated by onyx. This will fix the problem from the root cause.
_This root cause should be fixed but in parallel to that we can avoid notifying new Action when isSearchTopmostCentralPane() just the same as we are avoiding navigating to the report for the case search page is the active central pane
changed the title [-]Search - App redirects to DM when submitting expense in Search after deleting expense[/-][+][$250] Search - App redirects to DM when submitting expense in Search after deleting expense[/+]on Nov 26, 2024
changed the title [-][$250] Search - App redirects to DM when submitting expense in Search after deleting expense[/-][+][HOLD for payment 2025-01-02] [$250] Search - App redirects to DM when submitting expense in Search after deleting expense[/+]on Dec 26, 2024
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.78-6 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@DylanDylann@abekkala@DylanDylann 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: NA
[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: NA
[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 Nov 13, 2024
Triggered auto assignment to @abekkala (
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.FitseTLT commentedon Nov 13, 2024
Edited by proposal-police: This proposal was edited at 2024-11-13 14:46:43 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Search - App redirects to DM when submitting expense in Search after deleting expense
To reproduce:
Make sure you have an empty chat with someone (by creating an expense and deleting it so that it will appear in quick action menu in FAB)
then open search and create the expense from Quick action menu
What is the root cause of that problem?
When we
notifyNewActionwhen creating the expense scrollToBottomForCurrentUserAction is called and if the lastVisibleActionCreated timestamp differs from the lastAction.created, which would mean the report action list doesn't have newest report action, we navigate to the report so as to fetch the newest report action by triggering openReportApp/src/pages/home/report/ReportActionsList.tsx
Line 426 in 4d9be4e
Although we correctly update the lastVisibleActionCreated and lastAction this code is executed too quickly and by that time we don't have the correct updated values for both. So if we had any report action in the report then both values would be the same old values but as they will be equal this navigate code is not called (that's why we don't reproduce it on non-empty chats) but if we have a empty report before creating the expense the lastVisibleActionCreated will have a different value than the lastAction.created which is the created action.
BTW this navigate code is unnecessarily being called even when you submit expense from the report screen, the effect only became visible for this current issue because we were in search page.
What changes do you think we should make in order to solve the problem?
We need to give it a time before
scrollToBottomForCurrentUserActionis called so that we calculate according to the correct values of lastVisibleActionCreated and lastAction are populated by onyx. This will fix the problem from the root cause.App/src/pages/home/report/ReportActionsList.tsx
Line 448 in 4d9be4e
_This root cause should be fixed but in parallel to that we can avoid notifying new Action when
isSearchTopmostCentralPane()just the same as we are avoiding navigating to the report for the case search page is the active central paneApp/src/libs/actions/IOU.ts
Lines 3684 to 3685 in 4d9be4e
But we should do the same change in other cases such as sendInvoice trackExpense splitBill here createDistanceRequest ... cases in
IOU.tstoo. Or centralize the check insideReport.notifyNewActionWhat alternative solutions did you explore? (Optional)
As need to check if the current report screen is focused before executing it
App/src/pages/home/report/ReportActionsList.tsx
Line 422 in 4d9be4e
but if we don't want the scrollToBottom to be called we can add it here
App/src/pages/home/report/ReportActionsList.tsx
Line 419 in 4d9be4e
gijoe0295 commentedon Nov 13, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
In Step 11, app redirects to DM when submitting expense to user after deleting an expense in Search.
What is the root cause of that problem?
We call
notifyNewActionwhen completing the request:App/src/libs/actions/IOU.ts
Line 3685 in f23a5f0
In the new action event listener, we navigate to the DM report
App/src/pages/home/report/ReportActionsList.tsx
Line 426 in 37d9d90
What changes do you think we should make in order to solve the problem?
If the topmost central pane screen is
SearchCentralPane, we wouldn't need to callnotifyNewAction.FitseTLT commentedon Nov 13, 2024
Updated
melvin-bot commentedon Nov 19, 2024
@abekkala Huh... This is 4 days overdue. Who can take care of this?
melvin-bot commentedon Nov 21, 2024
@abekkala Still overdue 6 days?! Let's take care of this!
melvin-bot commentedon Nov 25, 2024
@abekkala 10 days overdue. Is anyone even seeing these? Hello?
[-]Search - App redirects to DM when submitting expense in Search after deleting expense[/-][+][$250] Search - App redirects to DM when submitting expense in Search after deleting expense[/+]melvin-bot commentedon Nov 26, 2024
Job added to Upwork: https://www.upwork.com/jobs/~021861529064896018849
54 remaining items
[-][$250] Search - App redirects to DM when submitting expense in Search after deleting expense[/-][+][HOLD for payment 2025-01-02] [$250] Search - App redirects to DM when submitting expense in Search after deleting expense[/+]melvin-bot commentedon Dec 26, 2024
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Dec 26, 2024
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.78-6 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-01-02. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Dec 26, 2024
@DylanDylann @abekkala @DylanDylann 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]
abekkala commentedon Jan 6, 2025
@DylanDylann can you complete the checklist above?
DylanDylann commentedon Jan 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: NA
[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: NA
[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:
Regression Test Proposal
Test:
Do we agree 👍 or 👎
abekkala commentedon Jan 7, 2025
@FitseTLT and @DylanDylann payments sent and contracts ended - thank you! 🎉