-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Workspace - User can navigate to deleted workspace editor while offline #54582
Comments
Triggered auto assignment to @slafortune ( |
Edited by proposal-police: This proposal was edited at 2024-12-26 19:04:03 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.User is able to navigate to workspace editor in a deleted workspace while offline What is the root cause of that problem?The condition to display not found page now doesn't check the policy is pending delete App/src/pages/ReimbursementAccount/ReimbursementAccountPage.tsx Lines 436 to 439 in 56e35ce
What changes do you think we should make in order to solve the problem?
App/src/pages/ReimbursementAccount/ReimbursementAccountPage.tsx Lines 436 to 439 in 56e35ce
App/src/pages/workspace/WorkspacePageWithSections.tsx Lines 156 to 160 in 58539c5
Or we can pass
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?What alternative solutions did you explore? (Optional)NA Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job. |
ProposalPlease re-state the problem that we are trying to solve in this issue.User can navigate to deleted workspace editor while offline What is the root cause of that problem?The actual cause is that we allow user to access the workspace via deep linking even when the policy is pending the App/src/pages/workspace/WorkspacePageWithSections.tsx Lines 156 to 160 in d649ce2
This causes the pages to show when the pending action is delete What changes do you think we should make in order to solve the problem?We need to add a extra check in const shouldShow = useMemo(() => {
// If the policy object doesn't exist or contains only error data, we shouldn't display it.
if (((isEmptyObject(policy) || PolicyUtils.isPendingDeletePolicy(policy) ||(Object.keys(policy).length === 1 && !isEmptyObject(policy.errors))) && isEmptyObject(policyDraft)) || shouldShowNotFoundPage) {
return true;
} App/src/pages/workspace/WorkspacePageWithSections.tsx Lines 156 to 160 in d649ce2
We also need to update
Note that the whole policy options need to be blocked here and not just the bank option as in delete case, the more features/ categories show a not found page: What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?N/A this is a UI bug What alternative solutions did you explore? (Optional) |
Updated proposal to fix other places if we want to fix this here. |
Edited by proposal-police: This proposal was edited at 2024-12-26 22:40:30 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.Workspace - User can navigate to deleted workspace editor while offline What is the root cause of that problem?We already show not found page for pending delete for both WorkspaceInitialPage
and WorkspacePageWithSections
but that only happens in online mode b/c shouldShowPolicy returns true for pending delete workspaces for offline case Lines 218 to 223 in 12e0941
this behaviour is correct for WorkspaceListPage here because we want to show the pending delete workspace in offline mode but not in these places. What changes do you think we should make in order to solve the problem?We should first rename isOffline param of shouldShowPolicy to App/src/pages/workspace/WorkspacePageWithSections.tsx Lines 154 to 155 in 12e0941
and additionally here to display not found for the case of worspace inital setting page App/src/pages/workspace/WorkspaceInitialPage.tsx Lines 347 to 348 in 12e0941
And additionally for WorkspacePageWithSections there is a problem of offline indicator showing on the top of the page for small screen (because we shouldForceFullScreen that will make the view fixed position and it distorts the normal display of the offline indicator on the bottom of the screen) so as we don't show the wide screen offline indicator when not found page is displayed here we can make it consistent with it and disable the small screen offline indicator when displaying not found page so add
but if we want to show offline indicator when displaying not found page in WorkspacePageWithSections like we do in WorkspaceInitialPage we can make the shouldForceFullScreen here to apply only to large screens (!shouldUseNarrowLayout or !isSmallScreenWidth) because we don't need it for small screen and the offline indicator will display in the bottom correctly. What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?What alternative solutions did you explore? (Optional) |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: v9.0.78-4
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: N/A
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Email or phone of affected tester (no customers): N/A
Issue reported by: Applause Internal Team
Action Performed:
Expected Result:
User should not be able to navigate to workspace editor after the workspace has been deleted (as in PR #27743)
Actual Result:
User is able to navigate to workspace editor in a deleted workspace while offline
Workaround:
Unknown
Platforms:
Screenshots/Videos
bug.mp4
View all open jobs on GitHub
The text was updated successfully, but these errors were encountered: