You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unable to delete newly created workspace in new account #41357
Created a new account in staging.new.expensify.com
Create a new workspace
Select the created workspace
Click three dot menu and delete the workspace
Expected Result:
Workspace deleted
Actual Result:
Unable to delete workspace and "Looks like you're on an annual subscription. Please downgrade your account from your account settings before trying again" error
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
changed the title [-]Unable to delete newly created workspace in new account[/-][+][$250] Unable to delete newly created workspace in new account[/+]on May 1, 2024
Allowing the policy to be deleted if it's during the free trial seems to be pretty easy (I'm often wrong when I say that). But should there be any additional criteria to check?
What should happen to the subscription afterwards (it's automatically set to yearly when on a free trial), should it be cancelled or stay as is? Are there any edge cases that we should think about here?
When running the DeletePolicy command, auth.policy.validateCanDelete no longer will return an error when you are deleting the last paid policy while on the yearly plan, but only if the following conditions are met:
remaining policy has no items that should be billed (shouldBillLastPolicy)
the allowDowngrade function param is set to true (defaults to false, but will be true just for the DeletePolicy command)
account has no purchases (Account::canDowngrade(db, accountID))
If the above conditions are met, subscription type will be downgraded from yearly to monthly, and the policy will be deleted
There's no condition for free trials here, because free trial is triggered only if a billable action was made in a policy.
If you agree with the above process, I'll submit the PR to review.
@mjasikowski—I'm back from Holiday and catching up. I reviewed the Slack conversation, and it looks like we are all set to continue here. Is there any update on when the PR will be ready? Thanks!
Activity
melvin-bot commentedon Apr 30, 2024
Triggered auto assignment to @dylanexpensify (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.trjExpensify commentedon May 1, 2024
I ran into this myself today.
Logs are here (internal only, sorry).
I'm hitting this block when I don't think I should be: https://github.com/Expensify/Auth/blob/01554c45bd48e4cae90b02a23e96f943cb90698c/auth/lib/Policy.cpp#L2755-L2761
So I think somehow NewDot isn't recognising that the workspace I'm trying to delete is on a free trial and it's throwing this error.
melvin-bot commentedon May 1, 2024
Job added to Upwork: https://www.upwork.com/jobs/~01fc08a6832d88aa3c
[-]Unable to delete newly created workspace in new account[/-][+][$250] Unable to delete newly created workspace in new account[/+]melvin-bot commentedon May 1, 2024
Triggered auto assignment to Contributor-plus team member for initial proposal review - @getusha (
External)trjExpensify commentedon May 1, 2024
Sending external for more eyes.
178 remaining items
mjasikowski commentedon Nov 22, 2024
Sorry for unassigning, the github assignee dropdown played some weird tricks on me.
mjasikowski commentedon Nov 22, 2024
Allowing the policy to be deleted if it's during the free trial seems to be pretty easy (I'm often wrong when I say that). But should there be any additional criteria to check?
What should happen to the subscription afterwards (it's automatically set to yearly when on a free trial), should it be cancelled or stay as is? Are there any edge cases that we should think about here?
carlosmiceli commentedon Nov 22, 2024
@mjasikowski hello sir, can you confirm that your fix would solve this issue?
mjasikowski commentedon Nov 23, 2024
@carlosmiceli Can't confirm yet. I'll let you know when I figure out the complete workflow.
mjasikowski commentedon Nov 26, 2024
@garrettmknight @carlosmiceli @alexpensify @trjExpensify I made some changes to my draft PR. Let me know if the following solution works for you in principle:
auth.policy.validateCanDeleteno longer will return an error when you are deleting the last paid policy while on the yearly plan, but only if the following conditions are met:shouldBillLastPolicy)allowDowngradefunction param is set to true (defaults to false, but will be true just for the DeletePolicy command)There's no condition for free trials here, because free trial is triggered only if a billable action was made in a policy.
If you agree with the above process, I'll submit the PR to review.
garrettmknight commentedon Nov 27, 2024
Pulled into slack for some thoughts.
alexpensify commentedon Dec 5, 2024
@mjasikowski—I'm back from Holiday and catching up. I reviewed the Slack conversation, and it looks like we are all set to continue here. Is there any update on when the PR will be ready? Thanks!
mjasikowski commentedon Dec 5, 2024
@alexpensify the PR is already merged!
alexpensify commentedon Dec 5, 2024
Whoops, sorry I missed it. Can you share the PR link here? I don't see one associated with this GH. Thanks!
mjasikowski commentedon Dec 5, 2024
Sure thing, it's https://github.com/Expensify/Auth/pull/13280
alexpensify commentedon Dec 12, 2024
@mjasikowski - since the PR was merged, can we close this one or are we waiting for another update? Thanks!
mjasikowski commentedon Dec 12, 2024
@alexpensify let's close it!