Skip to content
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

Unable to delete newly created workspace in new account #41357

Closed
2 of 6 tasks
m-natarajan opened this issue Apr 30, 2024 · 110 comments
Closed
2 of 6 tasks

Unable to delete newly created workspace in new account #41357

m-natarajan opened this issue Apr 30, 2024 · 110 comments
Assignees
Labels
Internal Requires API changes or must be handled by Expensify staff NewFeature Something to build that is a new item. Reviewing Has a PR in review Weekly KSv2

Comments

@m-natarajan
Copy link

m-natarajan commented Apr 30, 2024

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: 1.4.68-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
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: @Puneet-here
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1714499352473189

Action Performed:

  1. Created a new account in staging.new.expensify.com
  2. Create a new workspace
  3. Select the created workspace
  4. 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?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

image (21)

delete.newly.created.workspace.mp4

Add any screenshot/video evidence

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01fc08a6832d88aa3c
  • Upwork Job ID: 1785688967359610880
  • Last Price Increase: 2024-05-22
Issue OwnerCurrent Issue Owner: @mjasikowski
@m-natarajan m-natarajan added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Apr 30, 2024
Copy link

melvin-bot bot commented 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
Copy link
Contributor

I ran into this myself today.

  1. I was able to delete the same workspace on OldDot, but not NewDot.
  2. I checked I was still in the 7-day free trial window

Logs are here (internal only, sorry).

Throw ExpException - a8948deec2009297362f103209a7a026 ~~ message: '401 Can't delete last policy under a yearly subscription' exceptionMessage: 'Auth DeletePolicy returned an error' exceptionFile: '/git/releases/expensify.com/64247c4/lib/Auth.php' exceptionLine: '125' exceptionCode: '401'

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.

@trjExpensify trjExpensify added the External Added to denote the issue can be worked on by a contributor label May 1, 2024
Copy link

melvin-bot bot commented May 1, 2024

Job added to Upwork: https://www.upwork.com/jobs/~01fc08a6832d88aa3c

@melvin-bot melvin-bot bot changed the title Unable to delete newly created workspace in new account [$250] Unable to delete newly created workspace in new account May 1, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label May 1, 2024
Copy link

melvin-bot bot commented May 1, 2024

Triggered auto assignment to Contributor-plus team member for initial proposal review - @getusha (External)

@trjExpensify
Copy link
Contributor

Sending external for more eyes.

@melvin-bot melvin-bot bot added the Overdue label May 3, 2024
@getusha
Copy link
Contributor

getusha commented May 3, 2024

Looks like a backend issue, i'll try to reproduce and confirm.

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels May 3, 2024
Copy link

melvin-bot bot commented May 7, 2024

@dylanexpensify, @getusha Whoops! This issue is 2 days overdue. Let's get this updated quick!

@dylanexpensify
Copy link
Contributor

@getusha did we confirm?

@melvin-bot melvin-bot bot removed the Overdue label May 7, 2024
@getusha
Copy link
Contributor

getusha commented May 7, 2024

I am unable to reproduce, @m-natarajan is there a prerequisite for the account?

Screen.Recording.2024-05-07.at.3.57.12.in.the.afternoon.mov

Copy link

melvin-bot bot commented May 8, 2024

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@melvin-bot melvin-bot bot added the Overdue label May 9, 2024
Copy link

melvin-bot bot commented May 10, 2024

@dylanexpensify, @getusha Whoops! This issue is 2 days overdue. Let's get this updated quick!

@dylanexpensify
Copy link
Contributor

bump @m-natarajan

@melvin-bot melvin-bot bot removed the Overdue label May 14, 2024
Copy link

melvin-bot bot commented May 14, 2024

@dylanexpensify @getusha 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!

Copy link

melvin-bot bot commented May 15, 2024

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@trjExpensify trjExpensify added the Hot Pick Ready for an engineer to pick up and run with label Nov 7, 2024
@trjExpensify
Copy link
Contributor

Moving this to #convert, per here.

@alexpensify
Copy link
Contributor

I asked a question in the Slack 🧵 to confirm the Hot Pick status.

@carlosmiceli carlosmiceli removed their assignment Nov 14, 2024
@carlosmiceli
Copy link
Contributor

Just unassigned myself @alexpensify, if it's still happening when I'm done with a few issues I can take it back, but hopefully someone will fix it sooner :)

@danielrvidal
Copy link
Contributor

I'll call it out for hot picks this week!

@alexpensify
Copy link
Contributor

Weekly Update: Hot Pick

@mjasikowski
Copy link
Contributor

I'll take this.

@mjasikowski mjasikowski removed the Hot Pick Ready for an engineer to pick up and run with label Nov 22, 2024
@mjasikowski
Copy link
Contributor

Sorry for unassigning, the github assignee dropdown played some weird tricks on me.

@mjasikowski
Copy link
Contributor

mjasikowski commented 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
Copy link
Contributor

@mjasikowski hello sir, can you confirm that your fix would solve this issue?

@mjasikowski
Copy link
Contributor

@carlosmiceli Can't confirm yet. I'll let you know when I figure out the complete workflow.

@mjasikowski
Copy link
Contributor

mjasikowski commented 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:

  1. 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))
  2. 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.

@garrettmknight
Copy link
Contributor

@mjasikowski mjasikowski added the Reviewing Has a PR in review label Dec 3, 2024
@alexpensify
Copy link
Contributor

@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
Copy link
Contributor

@alexpensify the PR is already merged!

@alexpensify
Copy link
Contributor

Whoops, sorry I missed it. Can you share the PR link here? I don't see one associated with this GH. Thanks!

@mjasikowski
Copy link
Contributor

@alexpensify
Copy link
Contributor

@mjasikowski - since the PR was merged, can we close this one or are we waiting for another update? Thanks!

@mjasikowski
Copy link
Contributor

@alexpensify let's close it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Internal Requires API changes or must be handled by Expensify staff NewFeature Something to build that is a new item. Reviewing Has a PR in review Weekly KSv2
Projects
Development

No branches or pull requests