-
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
[HOLD for payment 2025-02-05] [$250] 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) |
@slafortune Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
Job added to Upwork: https://www.upwork.com/jobs/~021873785256425821183 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @rayane-djouah ( |
@slafortune, @rayane-djouah Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
Will review today |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
Hi all, I believe we need to address this issue across all workspace pages (e.g., Many workspace pages utilize the App/src/pages/workspace/AccessOrNotFoundWrapper.tsx Lines 156 to 157 in 66f7954
To handle workspaces that are pending deletion, I propose modifying Additionally, could someone clarify the distinction between |
@rayane-djouah Yep that's what I suggested in my proposal we can indeed use AccessOrNotFoundWrapper with the details to be thought on PR phase. shouldShowPolicy: we should use it to determine if the workspace can be shown in the workspace list page so we show pending deleted policies in offline mode and if the policy has errors or If it is join request pending and so on. isPolicyAccessible: we are using it to check the policy is not empty has proper id and has more than one keys or has no errors so we can incorporate the new logic of disallowing pending delete policies in it. We use it in AccessOrNotFoundWrapper and to determine if we should push the workspace initial page on the nav state here App/src/libs/Navigation/AppNavigator/createCustomFullScreenNavigator/CustomFullScreenRouter.tsx Lines 33 to 36 in 7ea58c7
So they have different purposes and regarding not found page for non-accessible policies isPolicyAccessible is the most appropriate function as shouldShowPolicy allows pending request workspaces so we can update isPolicyAccessible logic to exclude pending delete workspaces and use it in AccessOrNotFoundWrapper to cover a lot of workspace pages and also in other pages like WorkspacePageWithSections.tsx as needed. We can also consider a logic similar to getActivePolicies by adding more checks like the existence of role for the user on policy and other manadatory props like name on the policy to make it more strict. But we can work on the detail in the PR phase 👍 |
@rayane-djouah |
@slafortune @rayane-djouah this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks! |
PR will be ready tomorrow |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.90-6 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 2025-02-05. 🎊 For reference, here are some details about the assignees on this issue:
|
@rayane-djouah @slafortune @rayane-djouah The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button] |
BugZero Checklist:
Bug classificationSource of bug:
Where bug was reported:
Who reported the bug:
Regression Test Proposal
Do we agree 👍 or 👎 |
📣 @rayane-d! 📣
|
@rayane-d can you please accept the offer - https://www.upwork.com/nx/wm/offer/105681465 |
@slafortune - My eligibility for NewDot payments began on December 28, 2024, and I was assigned to this issue on December 30 #54582 (comment). Please provide a payment summary for me; I will request on NewDot |
OH! I looked at those dates backwards! Thanks for calling it out. |
@FitseTLT Role Contributor - was paid $250 via Upwork |
Upworks offer withdrawn |
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
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @slafortuneThe text was updated successfully, but these errors were encountered: