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

[server] don't always throw exception in deleteUser #5289

Merged
merged 1 commit into from
Aug 20, 2021

Conversation

JanKoehnlein
Copy link
Contributor

Fixes #5262

@laushinka
Copy link
Contributor

/lgtm

@roboquat
Copy link
Contributor

LGTM label has been added.

Git tree hash: afc681ebe5a329e2074dea9647ad3403adea8cae

@roboquat
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: laushinka

Associated issue: #5262

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@JanKoehnlein JanKoehnlein marked this pull request as ready for review August 20, 2021 09:19
@roboquat roboquat merged commit 58f0b33 into main Aug 20, 2021
@roboquat roboquat deleted the jk/deleting-account-5262 branch August 20, 2021 09:20
@gtsiolis
Copy link
Contributor

gtsiolis commented Aug 20, 2021

Thanks @JanKoehnlein for fixing this and @laushinka for reviewing! 🏓

@@ -61,7 +61,7 @@ export class UserDeletionServiceEE extends UserDeletionService {
}

await super.deleteUser(id);
if (errors) {
if (errors.length > 0) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JanKoehnlein, actually, after seeing more instances of this issue, I belief it's not a good idea in general to throw an error after super.deleteUser is actually done.
This leads to a state, where one's account is locked in a deleted state. This definitely requires proper handling in the frontend.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was mostly worried about users that have a GitHub-based subscription. They actually cannot cancel that subscription using our service, so they should get a message. Similar when Chargebee fails any reason. In any case, users wanted to delete their account so I thought it would be OK if that is the state on the Gitpod side.

But I am all in for proper error propagation to the frontend. Just unsure which actions should be taken/rolled back on the Gitpod side if some of the error conditions are met.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's not an easy issue to solve. While error propagation isn't the real adventure, to decide on the loose end is, especially because the account data will be deleted.
Maybe we should not call super.deleteUser if there are issues to cancel subscription. AND propagate an error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deleting account returns an error and does not log out the user properly
5 participants