-
Notifications
You must be signed in to change notification settings - Fork 3.2k
[C+ Checklist Needs Completion] [$250] Unable to delete workspace/Workspace shown with Strikethrough font #53413
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
Comments
Triggered auto assignment to @greg-schroeder ( |
Edited by proposal-police: This proposal was edited at 2024-12-03 03:13:27 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.Unable to delete workspace/Workspace shown with Strikethrough font What is the root cause of that problem?The current behavior requires dismissing the error message if we want to continue deleting the workspace after it appears. Once the error is dismissed, the action to delete the workspace can proceed as normal. Screen.Recording.2024-12-03.at.09.55.59.mp4Because calling
After clearing the workspace error, the
What changes do you think we should make in order to solve the problem?To resolve this issue, I suggest we should automatically call const [privateSubscription] = useOnyx(ONYXKEYS.NVP_PRIVATE_SUBSCRIPTION);
const isAnnual = privateSubscription?.type === CONST.SUBSCRIPTION.TYPE.ANNUAL;
//src/pages/workspace/WorkspacesListPage.tsx#L370
useEffect(() => {
if (!policies || isAnnual) {
return;
}
const processPolicies = () => {
const policiesList = Object.values(policies)
.filter((policy): policy is PolicyType => PolicyUtils.shouldShowPolicy(policy, isOffline, session?.email))
.map((item) => ({id: item.id, pendingAction: item.pendingAction}));
policiesList.forEach((item) => {
dismissWorkspaceError(item.id, item.pendingAction);
});
};
processPolicies();
// tThis code only executes when going back to the workspace, and to avoid the case where we change `yearly` -> `monthly` -> `yearly`.
}, []); POCScreen.Recording.2024-12-03.at.10.09.38.mp4What alternative solutions did you explore? (Optional)Or if we want to clear the red dot, we can add a dependency to the props before going back, something like that: const [privateSubscription] = useOnyx(ONYXKEYS.NVP_PRIVATE_SUBSCRIPTION);
const isAnnual = privateSubscription?.type === CONST.SUBSCRIPTION.TYPE.ANNUAL;
//src/pages/workspace/WorkspacesListPage.tsx#L370
useEffect(() => {
if (!policies || isAnnual) {
return;
}
const processPolicies = () => {
const policiesList = Object.values(policies)
.filter((policy): policy is PolicyType => PolicyUtils.shouldShowPolicy(policy, isOffline, session?.email))
.map((item) => ({id: item.id, pendingAction: item.pendingAction}));
policiesList.forEach((item) => {
dismissWorkspaceError(item.id, item.pendingAction);
});
};
processPolicies();
}, [isAnnual]); POCScreen.Recording.2024-12-03.at.10.10.23.mp4Alternative solutions 2: Or we can call
const onOptionSelected = (option: SubscriptionType) => {
if (privateSubscription?.type === CONST.SUBSCRIPTION.TYPE.ANNUAL && option === CONST.SUBSCRIPTION.TYPE.PAYPERUSE && !account?.canDowngrade) {
Navigation.navigate(ROUTES.SETTINGS_SUBSCRIPTION_SIZE.getRoute(0));
return;
}
if (option === CONST.SUBSCRIPTION.TYPE.PAYPERUSE && policies) {
const policiesList = Object.values(policies)
.filter((policy): policy is PolicyType => PolicyUtils.shouldShowPolicy(policy, isOffline, session?.email))
.map((item) => ({id: item.id, pendingAction: item.pendingAction}));
policiesList.forEach((item) => {
if (item.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE) {
return;
}
Policy.clearDeleteWorkspaceError(item.id);
});
}
Subscription.updateSubscriptionType(option);
}; Note: I've recorded a proof of concept (POC) for each behavior with two solutions. If we need a different behavior, we can continue the discussion in the PR phase |
ProposalPlease re-state the problem that we are trying to solve in this issue.When after changing from Annual to Pay Per Use, error message on workspace settings isn't deleted. What is the root cause of that problem?When entering workspace settings, no function activates to dismiss the error message thought we have App/src/pages/workspace/WorkspacesListPage.tsx Lines 88 to 92 in 583f777
And this part renders error message for delete whenever rendering workspace list and here isn't any function for the issue: App/src/pages/workspace/WorkspacesListPage.tsx Lines 320 to 356 in 583f777
What changes do you think we should make in order to solve the problem?We can add a condition to dismiss error message. When the user changed from Annual to Pay Per Use, private subscription is changed. We can add //// add this
const subscription = useOnyx(ONYXKEYS.NVP_PRIVATE_SUBSCRIPTION);
//// add this
...
action: () => null,
dismissError: () => null,
isJoinRequestPending: true,
};
}
//// add these
if(policy.errors && policy.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE && subscription.at(0).type === CONST.SUBSCRIPTION.TYPE.PAYPERUSE) {
dismissWorkspaceError(policy.id, policy.pendingAction)
}
//// add these
return {
title: policy.name,
icon: policy.avatarURL ? policy.avatarURL : ReportUtils.getDefaultWorkspaceAvatar(policy.name),
action: () => Navigation.navigate(ROUTES.WORKSPACE_INITIAL.getRoute(policy.id)),
... Then when there is error for deleting a workspace and when subscription is Pay Per Use, workspace error will be dismissed. What alternative solutions did you explore? (Optional)N/A |
This is expected we need to first dismiss the error. |
@greg-schroeder Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
ProposalPlease re-state the problem that we are trying to solve in this issue.If the workspace deletion failed, the workspace list row stays disabled until we clear the error. What is the root cause of that problem?When we delete the workspace, we set the pending action to DELETE. This disables the workspace item.
It makes sense to disable it because we already archived all its report, so it doesn't make sense if the user can open the 3-dot menu again to delete it again. The problem here is that, after it fails, the pending action isn't cleared. What changes do you think we should make in order to solve the problem?Clears the pending action in App/src/libs/actions/Policy/Policy.ts Lines 365 to 380 in b9107bf
(or What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?We can create a test in PolicyTests following the existing test there. The thing that we need to test is that after the request is failed, the policy onyx data |
Job added to Upwork: https://www.upwork.com/jobs/~021865088803803540719 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @alitoshmatov ( |
Set |
@alitoshmatov will review soon! |
@greg-schroeder, @alitoshmatov Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
I am easily able to delete workspace even if subscription is annual. Can we anyone make sure it is still reproducible, if yes I will reassign this issue |
I also was able to do it as well just now testing. Huh. |
Let's close as not reproducible for now, but please comment/reopen if you disagree |
I can still reproduce this. You need to make sure you are deleting the last workspace from the account. a.mp4 |
PR is ready cc: @alitoshmatov |
Issue not reproducible during KI retests. (First week) |
@alitoshmatov is still on the review ... looks like he asked @srikarparsi for help. Do you mind taking a look at the PR and weighing in? |
Work continues on linked PR |
This issue has not been updated in over 15 days. @greg-schroeder, @srikarparsi, @bernhardoj, @alitoshmatov eroding to Monthly issue. P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do! |
@alitoshmatov I think you're next up on the linked PR as I see you requested for review |
@greg-schroeder, @srikarparsi, @bernhardoj, @alitoshmatov Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.89-8 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-04. 🎊 For reference, here are some details about the assignees on this issue:
|
@alitoshmatov @greg-schroeder @alitoshmatov 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] |
Payment Summary
BugZero Checklist (@greg-schroeder)
|
Bump @alitoshmatov on the checklist! Then we can close. |
BugZero Checklist:
Bug classificationSource of bug:
Where bug was reported:
Who reported the bug:
No regression needed. Reproducing original issue is also hard since the error condition required for reproduction is not present now |
Thanks @alitoshmatov! |
Requested in ND. |
$250 approved for @bernhardoj |
$250 approved for @alitoshmatov |
Uh oh!
There was an error while loading. Please reload this page.
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Version Number: 9.0.70-0
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?:
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: @VictoriaExpensify
Slack conversation (hyperlinked to channel name): ts_external_expensify_expense
Action Performed:
Expected Result:
Error message dismissed and user able to delete the workspace
Actual Result:
Error message not dismissed, unable to delete the workspace as its greyed out
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Recording.814.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @greg-schroederThe text was updated successfully, but these errors were encountered: