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 2023-11-29] [$500] Status - Different chat report opens when clicking on the back button in Status modal #30509
Version Number: v1.3.92-0 Reproducible in staging?: Y Reproducible in production?: Y If this was caught during regression testing, add the test name, ID and link from TestRail: Email or phone of affected tester (no customers): Logs:https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by: Applause-Internal Team Slack conversation: @
Action Performed:
Precondition: User has set a status.
Go to staging.new.expensify.com
Open different chat reports.
Click on the status on the top left.
Click on the back button.
Expected Result:
The current chat report remains open.
Actual Result:
A different chat report opens.
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
changed the title [-]Status - Different chat report opens when clicking on the back button in Status modal[/-][+][$500] Status - Different chat report opens when clicking on the back button in Status modal[/+]on Oct 27, 2023
Please re-state the problem that we are trying to solve in this issue.
Different chat report opens when clicking on the back button in Status modal
What is the root cause of that problem?
In the StatusPage we pass navigateBackToSettingsPage into onBackButtonPress prop.
In navigateBackToSettingsPage we pass the param shouldPopToTop = true here
What changes do you think we should make in order to solve the problem?
I think we can remove the shouldPopToTop param
Navigation.goBack(ROUTES.SETTINGS_PROFILE,false)
What alternative solutions did you explore? (Optional)
Please re-state the problem that we are trying to solve in this issue.
A different chat report opens when clicking back button in status modal.
What is the root cause of that problem?
We're setting shouldPopToTop: true when going back from the status page here. We're also calling setShouldPopAllStateOnUPhere in the Avatar status.
This is so that:
If the user navigates to the StatusPage from the Avatar status, they should go back to the LHN (or the last report in the background, in case of wide screen)
If the user navigates to the StatusPage via deep link (not going through the Avatar status), they should go back to the Profile settings page normally (because in this case setShouldPopAllStateOnUP is not set)
But this causes a side effect, which is this issue, where we go back to a different report, because the report that was open when avatar status is clicked might not be the last read report of the LHN.
What changes do you think we should make in order to solve the problem?
We just need to add a condition, if there's a report open in the background of the status page (in that case there exists a topmost report id), we should go back to that report instead. We can update this to
changed the title [-][$500] Status - Different chat report opens when clicking on the back button in Status modal[/-][+][HOLD for payment 2023-11-29] [$500] Status - Different chat report opens when clicking on the back button in Status modal[/+]on Nov 22, 2023
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.1-13 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 2023-11-29. 🎊
After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.
External issue reporter — Applause Team, so no payment needed
Contributor that fixed the issue — @shubham1206agra paid $500 via Upwork
Contributor+ that helped on the issue and/or PR — @dukenv0307 paid $500 via Upwork
For reference, here are some details about the assignees on this issue:
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
[@shubham1206agra] The PR that introduced the bug has been identified. Link to the PR:
[@shubham1206agra] 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:
[@shubham1206agra] A discussion in #expensify-bugs 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:
[@shubham1206agra] Determine if we should create a regression test for this bug.
[@shubham1206agra] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
[@shubham1206agra] A discussion in #expensify-bugs 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: https://expensify.slack.com/archives/C02NK2DQWUX/p1698756003834449 (This old discussion is in #contributor-plus channel)
[@shubham1206agra] Determine if we should create a regression test for this bug. Yes
[@shubham1206agra] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
Open the App with an account that has a status set already.
Activity
[-]Status - Different chat report opens when clicking on the back button in Status modal[/-][+][$500] Status - Different chat report opens when clicking on the back button in Status modal[/+]melvin-bot commentedon Oct 27, 2023
Job added to Upwork: https://www.upwork.com/jobs/~01f903eb3ac10fe198
melvin-bot commentedon Oct 27, 2023
Triggered auto assignment to @CortneyOfstad (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Oct 27, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)melvin-bot commentedon Oct 27, 2023
Triggered auto assignment to Contributor-plus team member for initial proposal review - @shubham1206agra (
External)namhihi237 commentedon Oct 27, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
Different chat report opens when clicking on the back button in Status modal
What is the root cause of that problem?
In the StatusPage we pass navigateBackToSettingsPage into onBackButtonPress prop.
In navigateBackToSettingsPage we pass the param shouldPopToTop = true here
What changes do you think we should make in order to solve the problem?
I think we can remove the shouldPopToTop param
What alternative solutions did you explore? (Optional)
N/A
dummy-1111 commentedon Oct 27, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
When go to status page after navigating several reports, back button navigates to the report other than the current report
What is the root cause of that problem?
When we navigate to status page, we set
shouldPopAllStateOnUPto true and go to the pageApp/src/pages/home/sidebar/AvatarWithOptionalStatus.js
Line 36 in 1fc2bbc
And when we go back, we call
navigate.goBackwithshouldPopToTop = trueApp/src/pages/settings/Profile/CustomStatus/StatusPage.js
Line 53 in 1fc2bbc
This makes the route stack pop to the first page, which is home page.
App/src/libs/Navigation/Navigation.js
Lines 107 to 113 in 1fc2bbc
For wide screen devices, we navigate to the last accessed report when navigating to home page
App/src/libs/Navigation/AppNavigator/ReportScreenIDSetter.js
Line 86 in ee5e6de
We determine the last access report by its lastReadTime.
App/src/libs/ReportUtils.js
Line 553 in ee5e6de
The problem is here. When we call

OpenReportAPI,lastReadTimeisn't updatedThis is the root cause
What changes do you think we should make in order to solve the problem?
I think this issue should be fixed in the backend.
OpenReportcall should return the updatedlastReadTimeWhat alternative solutions did you explore? (Optional)
We can simply call
Navigation.goBack(ROUTES.SETTINGS_PROFILE), that is, call goBack withshouldPopToTop = falsedukenv0307 commentedon Oct 28, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
A different chat report opens when clicking back button in status modal.
What is the root cause of that problem?
We're setting
shouldPopToTop: truewhen going back from the status page here. We're also callingsetShouldPopAllStateOnUPhere in the Avatar status.This is so that:
setShouldPopAllStateOnUPis not set)But this causes a side effect, which is this issue, where we go back to a different report, because the report that was open when avatar status is clicked might not be the last read report of the LHN.
What changes do you think we should make in order to solve the problem?
We just need to add a condition, if there's a report open in the background of the status page (in that case there exists a topmost report id), we should go back to that report instead. We can update this to
This will keep our intended behavior for using
shouldPopToTop, while fixing the side effect that causes this issue.What alternative solutions did you explore? (Optional)
NA
25 remaining items
[-][$500] Status - Different chat report opens when clicking on the back button in Status modal[/-][+][HOLD for payment 2023-11-29] [$500] Status - Different chat report opens when clicking on the back button in Status modal[/+]melvin-bot commentedon Nov 22, 2023
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Nov 22, 2023
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.1-13 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 2023-11-29. 🎊
After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Nov 22, 2023
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
shubham1206agra commentedon Nov 24, 2023
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
CortneyOfstad commentedon Dec 1, 2023
@shubham1206agra @dukenv0307 — both of you have been paid in NewDot and regression test was created here — closing!