-
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 showing not found page after deleting a workspace #38488
Fix showing not found page after deleting a workspace #38488
Conversation
@jayeshmangwani 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] |
@WojtekBoman Please upload Screenshots/Videos for all the platforms |
@jayeshmangwani Done :) |
@@ -143,7 +143,7 @@ function WorkspacePageWithSections({ | |||
return true; | |||
} | |||
|
|||
return (!isEmptyObject(policy) && !PolicyUtils.isPolicyAdmin(policy) && !shouldShowNonAdmin) || PolicyUtils.isPendingDeletePolicy(policy); | |||
return !isEmptyObject(policy) && !PolicyUtils.isPolicyAdmin(policy) && !shouldShowNonAdmin; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change will cause the regression
- Go to the workspace that we going to delete
- Press Reimbursements > Copy the URL
- Press workspace Profile > Press Delete
- Go to any chat paste the workspace reimbursements URL and send
- Press the link, it will show the reimbursements page and we can edit the Rate
regression.mov
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To understand clearly the output I am attaching staging result.
staging.mov
I've tried to reproduce that, but it seems to work fine. Am I doing something wrong? I've noticed on your video that you still have the deleted workspace on the list, for me it disappears right after deletion. I've merged the latest main into this branch, maybe it impacts somehow Screen.Recording.2024-03-20.at.20.59.36.mov |
@WojtekBoman can you please try with below steps (I have updated the first step)
|
You need to be offline to reproduce this issue |
I've added the fix and now it should work fine in offline mode :) There is still one issue with the navigation history after deleting a workspace created from the workspace switcher, but it will no longer appear once I finish fixing this issue Screen.Recording.2024-03-20.at.21.56.47.movIt's also present on the main branch, so I believe we can go further with this |
Thanks for fixing @WojtekBoman ,I also can reproduce this double navigation issue on the main branch double-navigation.mov |
@WojtekBoman Can we please update the Tests steps like this:
Note: your attached videos does not reflect the original steps of reproduction steps |
@mountiny At the time of testing the PR we're facing another issue and Same issue is happens on staging, so we've not handled this in this PR, steps to reproduce issue
Now we can see a not found page instead of the going back to Home page(Chats) |
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid.movAndroid: mWeb ChromemWeb-chrome.moviOS: NativeiOS.moviOS: mWeb SafarimWeb-safari.movMacOS: Chrome / Safariweb.movMacOS: Desktopdesktop.mov |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, thanks for noticing that! I've already updated the test steps in the description and I'll attach new videos :) |
This issue will be fixed by this PR |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/pecanoro in version: 1.4.56-0 🚀
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 1.4.56-8 🚀
|
@@ -143,7 +145,11 @@ function WorkspacePageWithSections({ | |||
return true; | |||
} | |||
|
|||
return (!isEmptyObject(policy) && !PolicyUtils.isPolicyAdmin(policy) && !shouldShowNonAdmin) || PolicyUtils.isPendingDeletePolicy(policy); | |||
// We check isPendingDelete for both policy and prevPolicy to prevent the NotFound view from showing right after we delete the workspace |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
coming from #49093, we should use PolicyUtils.shouldShowPolicy to check if workspace is deleted or not, More detaills #49093 (comment)
Details
This PR fixes showing not found page after deleting a workspace.
Fixed Issues
$ #38301 (comment)
PROPOSAL: N/A
Tests
Offline tests
N/A
QA Steps
Same as tests
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.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
Screen.Recording.2024-03-21.at.15.35.08.mov
Android: mWeb Chrome
Screen.Recording.2024-03-21.at.15.36.51.mov
iOS: Native
Screen.Recording.2024-03-21.at.15.37.38.mov
iOS: mWeb Safari
Screen.Recording.2024-03-21.at.15.33.36.mov
MacOS: Chrome / Safari
Screen.Recording.2024-03-21.at.15.31.34.mov
MacOS: Desktop
Screen.Recording.2024-03-21.at.15.32.57.mov