-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FIX: Not found page shows briefly when deleting a track expense #53408
base: main
Are you sure you want to change the base?
FIX: Not found page shows briefly when deleting a track expense #53408
Conversation
@shubham1206agra Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
@ikevin127 #51388 is failing for me Screen.Recording.2024-12-10.at.6.13.04.PM.mov |
This comment was marked as outdated.
This comment was marked as outdated.
@shubham1206agra I looked into the blank screen issue and this is what I found, related to this block:
which is calling: function navigateToConciergeChatAndDeleteReport(reportID: string, shouldPopToTop = false, shouldDeleteChildReports = false) {
// Dismiss the current report screen and replace it with Concierge Chat
if (shouldPopToTop) { // |
Navigation.setShouldPopAllStateOnUP(true); // |
} // | -> these 4 likes are responsible from going back from the
Navigation.goBack(undefined, undefined, shouldPopToTop); // | -> Debug - Report page after `Delete` confirmation
navigateToConciergeChat(); // | -> this is resonsible for navigating to the Concierge report
InteractionManager.runAfterInteractions(() => {
deleteReport(reportID, shouldDeleteChildReports);
});
} The issue here is that, because we removed the
In order to deal with this issue while keeping the
-function navigateToConciergeChatAndDeleteReport(reportID: string, shouldPopToTop = false, shouldDeleteChildReports = false) {
+function navigateToConciergeChatAndDeleteReport(reportID: string, shouldPopToTop = false, shouldDeleteChildReports = false, shouldPopTwice = false) {
// Dismiss the current report screen and replace it with Concierge Chat
if (shouldPopToTop) {
Navigation.setShouldPopAllStateOnUP(true);
}
Navigation.goBack(undefined, undefined, shouldPopToTop);
+ // When in Debug Mode and Delete report in DebugReportPage we need to pop
+ // two screens from the navigation stack before we navigate to concierge:
+ // ReportDetailsPage and ReportScreen, otherwise when going back from Concierge
+ // we'll see report skeleton page of deleted report.
+ if (shouldPopTwice) {
+ navigationRef.dispatch({...StackActions.pop()});
+ navigationRef.dispatch({...StackActions.pop()});
+ }
navigateToConciergeChat();
InteractionManager.runAfterInteractions(() => {
deleteReport(reportID, shouldDeleteChildReports);
This will work in the following way:
This fixes the issue with Debug mode delete report blank page or skeleton loading page when going back from the Concierge report, which will go back to Home (all chats) in all platforms or whatever the stack route behind Concierge report was before, proof from iOS: Native: ios.mp4 |
…7-withReportOrNotFoundFix
@shubham1206agra Ready for review once again! Addressed the mentioned issue in #53408 (comment). |
@ikevin127 Is there a reason why |
@shubham1206agra It works, but only for popping the first screen aka Debug - Report after we confirm The reason why I went with the new prop is because of backwards compatibility since the function is used in other components as well and I wouldn't want to break any of the previous functionality. |
@ikevin127 It should pop all the screens. Let me see why this is happening. |
@shubham1206agra Indeed, /**
* Pop to the first route in the stack, dismissing all other screens.
*/
popToTop(): void; Looks like
App/src/libs/Navigation/Navigation.ts Line 214 in 082e14b
I noticed that most of the dispatch calls with App/src/libs/Navigation/Navigation.ts Lines 304 to 311 in 082e14b
and also passing a EditI confirm that fixes the issue: if (shouldPopToTop) {
if (shouldPopAllStateOnUP) {
const rootState = navigationRef.getRootState(); // <- new line
shouldPopAllStateOnUP = false;
navigationRef.current?.dispatch({...StackActions.popToTop(), target: rootState.key}); // <- changed line
return;
}
} Will revert the last commit and apply this fix instead. |
@shubham1206agra I reverted that previous commit and fixed |
Explanation of Change
We're reverting the changes implemented by PR #51920 as the changes caused this issue - more details in the proposal.
Fixed Issues
$ #53301
PROPOSAL: #53301 (comment)
Tests
Delete expense
.It's not here
page doesn't show up when the expense is being deleted.Note
Since PR #53301 was fixing issue #51388 scenario but also an additional test case mentioned in #53301 (comment), besides our issue's tests - we need to ensure the 2 additional tests are passing as well.
Test for issue #51388:
Precondition: Go to profile icon (Settings) -> Troubleshoot > enable Debug mode.
Debug
.Delete
.Test for scenario mentioned in #53301 (comment):
Precondition: Create a new #room with Private visibility.
Offline tests
Same as QA Steps.
QA Steps
Delete expense
.It's not here
page doesn't show up when the expense is being deleted.Note
Since PR #53301 was fixing issue #51388 scenario but also an additional test case mentioned in #53301 (comment), besides our issue's tests - we need to ensure the 2 additional tests are passing as well.
Test for issue #51388:
Precondition: Go to profile icon (Settings) -> Troubleshoot > enable Debug mode.
Debug
.Delete
.Test for scenario mentioned in #53301 (comment):
Precondition: Create a new #room with Private visibility.
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
android.mp4
Android: mWeb Chrome
android-mweb.mp4
iOS: Native
ios.mp4
iOS: mWeb Safari
ios-mweb.mp4
MacOS: Chrome / Safari
web.mov
MacOS: Desktop
desktop.mov