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-12-29] [$1000] IOU - Hmm, not there screen briefly displayed when deleting one IOU out of several #28969
changed the title [-]IOU - Hmm, not there screen briefly displayed when deleting one IOU out of several[/-][+][$500] IOU - Hmm, not there screen briefly displayed when deleting one IOU out of several[/+]on Oct 6, 2023
Please re-state the problem that we are trying to solve in this issue.
"Hmm, not there" briefly is shown while navigating to the IOU preview
What is the root cause of that problem?
There're 2 broad scenarios where we're currently showing the Not found page in the report screen:
When the user actively accessed a report with incorrect id, or they access a report they don't have permissions for.
This is unexpected behavior from the user and so it makes sense to show the not found page
When the user does something in the app that leads to the report being deleted (delete money request, leave thread, the report is removed from another device).
This is normal scenario and we should not show the not found page in this case, but should make the UX seamless. This issue belongs to this case.
It happens because briefly after the report is removed, this condition becomes true and the not found page shows briefly before we navigate them to another screen
What changes do you think we should make in order to solve the problem?
We should check for the 2nd scenario and do not show the not found page in this case. For that scenario, the report was always available and accessible before it becomes empty, we can make use of this characteristics.
Add a wasReportAccessible ref to indicate whether the report was ever accessible to the user
const wasReportAccessibleRef = useRef(false);
When report.reportID is not empty and shouldHideReport is false, this means the report is accessible and we'll set wasReportAccessibleRef.current to true
In shouldShowNotFoundPagehere, we'll not return true if the report was accessible, we'll instead let our navigation (when deleting request, leave thread, ...) navigate the user to the correct report, and not show the brief not found page as in this case
Update:
After this change, it will surface an issue when deleting money request from another device as highlighted here. This is actually an existing unrelated bug, in this case the user should be navigated back to the parent report as per this code block (currently it shows not found page which is not good UX) which works for many other cases like user being removed from room in another device, ...
But that condition currently doesn't work for deleting money request from another device. We should add a check to this line: If the prevReport is a money request report or an iou report and report (current report) is the default props (means it's not available), then also goes to this block and do the navigation to parent IOU report).
What alternative solutions did you explore? (Optional)
Using isFocused as suggested above will cause several regressions when we open the search bar, the report page will turn from not found page to loading page.
@ZhenjaHorbach Thanks for the proposal. Your RCA is correct. But the solution looks like a workaround. The not found page should not be coupled with the focus state as it's unrelated.
@dukenv0307 Thanks for the proposal. Your RCA makes sense. However the solution won't work correctly in many cases. If the page is not found then we should show the not found view, even if it was accessible before. Otherwise we would have regressions e.g. if you are viewing a report of a workspace then the admin remove you from the workspace then you will still be looking at the same report instead of the not found page because the delete action was done remotely and our navigation will do nothing about it.
changed the title [-][$1000] IOU - Hmm, not there screen briefly displayed when deleting one IOU out of several[/-][+][HOLD for payment 2023-12-29] [$1000] IOU - Hmm, not there screen briefly displayed when deleting one IOU out of several[/+]on Dec 22, 2023
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.15-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 2023-12-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
Contributor that fixed the issue
Contributor+ that helped on the issue and/or PR
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:
[@s77rt] The PR that introduced the bug has been identified. Link to the PR:
[@s77rt] 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:
[@s77rt] 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:
[@s77rt] Determine if we should create a regression test for this bug.
[@s77rt] 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.
[@lschurr] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
Activity
melvin-bot commentedon Oct 6, 2023
Triggered auto assignment to @flaviadefaria (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Oct 6, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)[-]IOU - Hmm, not there screen briefly displayed when deleting one IOU out of several[/-][+][$500] IOU - Hmm, not there screen briefly displayed when deleting one IOU out of several[/+]melvin-bot commentedon Oct 6, 2023
Job added to Upwork: https://www.upwork.com/jobs/~0146ac43978a445e18
melvin-bot commentedon Oct 6, 2023
Triggered auto assignment to Contributor-plus team member for initial proposal review - @s77rt (
External)ZhenjaHorbach commentedon Oct 6, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
After deleting an IOU, we can replace
not there screenwhile closing the screenWhat is the root cause of that problem?
Since the deletion occurs before the end of the animation screen change
We can see this
not there screenWhat changes do you think we should make in order to solve the problem?
To fix this bug we can use isFocused to be sure that we want to show
not there screenonly when screen is focusedwe can update shouldShow value for FullPageNotFoundView in ReportScreen
isFocused we can get from @react-navigation/native library
const isFocused = useNavigation().isFocused()const isFocused = useIsFocused()And then pass here
shouldShow={shouldShowNotFoundPage && isFocused }App/src/pages/home/ReportScreen.js
Lines 377 to 384 in 4b0752a
What alternative solutions did you explore? (Optional)
NA
dukenv0307 commentedon Oct 6, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
"Hmm, not there" briefly is shown while navigating to the IOU preview
What is the root cause of that problem?
There're 2 broad scenarios where we're currently showing the Not found page in the report screen:
This is unexpected behavior from the user and so it makes sense to show the not found page
This is normal scenario and we should not show the not found page in this case, but should make the UX seamless. This issue belongs to this case.
It happens because briefly after the report is removed, this condition becomes true and the not found page shows briefly before we navigate them to another screen
What changes do you think we should make in order to solve the problem?
We should check for the 2nd scenario and do not show the not found page in this case. For that scenario, the report was always available and accessible before it becomes empty, we can make use of this characteristics.
wasReportAccessibleref to indicate whether the report was ever accessible to the userreport.reportIDis not empty andshouldHideReportis false, this means the report is accessible and we'll setwasReportAccessibleRef.currentto trueshouldShowNotFoundPagehere, we'll not return true if the report was accessible, we'll instead let our navigation (when deleting request, leave thread, ...) navigate the user to the correct report, and not show the brief not found page as in this caseUpdate:
After this change, it will surface an issue when deleting money request from another device as highlighted here. This is actually an existing unrelated bug, in this case the user should be navigated back to the parent report as per this code block (currently it shows not found page which is not good UX) which works for many other cases like user being removed from room in another device, ...
But that condition currently doesn't work for deleting money request from another device. We should add a check to this line: If the
prevReportis a money request report or an iou report andreport(current report) is the default props (means it's not available), then also goes to this block and do the navigation to parent IOU report).What alternative solutions did you explore? (Optional)
Using
isFocusedas suggested above will cause several regressions when we open the search bar, the report page will turn from not found page to loading page.s77rt commentedon Oct 6, 2023
@ZhenjaHorbach Thanks for the proposal. Your RCA is correct. But the solution looks like a workaround. The not found page should not be coupled with the focus state as it's unrelated.
s77rt commentedon Oct 6, 2023
@dukenv0307 Thanks for the proposal. Your RCA makes sense. However the solution won't work correctly in many cases. If the page is not found then we should show the not found view, even if it was accessible before. Otherwise we would have regressions e.g. if you are viewing a report of a workspace then the admin remove you from the workspace then you will still be looking at the same report instead of the not found page because the delete action was done remotely and our navigation will do nothing about it.
86 remaining items
[-][$1000] IOU - Hmm, not there screen briefly displayed when deleting one IOU out of several[/-][+][HOLD for payment 2023-12-29] [$1000] IOU - Hmm, not there screen briefly displayed when deleting one IOU out of several[/+]melvin-bot commentedon Dec 22, 2023
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Dec 22, 2023
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.15-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 2023-12-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 Dec 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:
lschurr commentedon Dec 22, 2023
Could you work on the checklist for this one @s77rt
s77rt commentedon Dec 22, 2023
s77rt commentedon Dec 22, 2023
@lschurr Done!
lschurr commentedon Dec 28, 2023
Payment summary:
lschurr commentedon Dec 29, 2023
Payments issued in Upwork. Closing this one out :)
melvin-bot commentedon Jan 11, 2024
If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.
If a regression has occurred and you are the assigned CM follow the instructions here.
If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.