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

[payment] cancel all subscriptions on user deletion #4501

Merged
merged 2 commits into from
Aug 12, 2021

Conversation

JanKoehnlein
Copy link
Contributor

@JanKoehnlein JanKoehnlein commented Jun 14, 2021

fixes #4229

@JanKoehnlein JanKoehnlein force-pushed the jankoehnlein/admin-cannot-delete-4229 branch from 06e2f33 to f5ff1c8 Compare June 18, 2021 13:58
@JanKoehnlein JanKoehnlein marked this pull request as ready for review June 21, 2021 14:09
@JanKoehnlein
Copy link
Contributor Author

Looks like we won't get a preview environment for these kind of changes in the near future. Please review such that we can test it on staging,

Copy link
Contributor

@corneliusludmann corneliusludmann left a comment

Choose a reason for hiding this comment

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

2 smaller comments or rather questions because I don't understand team subscriptions well enough.

components/server/ee/src/user/user-deletion-service.ts Outdated Show resolved Hide resolved
Comment on lines 45 to 46
const teamSlots = await this.teamSubscriptionService.findTeamSubscriptionSlotsByAssignee(id);
teamSlots.forEach(async ts => await this.teamSubscriptionService.deactivateSlot(ts.teamSubscriptionId, ts.id, now))
Copy link
Contributor

Choose a reason for hiding this comment

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

Could teamSlots be empty (expectedly or unexpectedly)? Do we need to handle this (logging/throwing an error etc.)?

@JanKoehnlein JanKoehnlein marked this pull request as draft June 28, 2021 12:36
return super.deleteUser(id);
await super.deleteUser(id);
if (errors) {
throw new Error(errors.join("\n"))
Copy link
Member

@svenefftinge svenefftinge Aug 12, 2021

Choose a reason for hiding this comment

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

why throwing the errors here? We still deleted the user and already logged any errors.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The idea was to give feedback to the caller, e.g. the admin dashboard.

In particular in the case of GitHub subscription, it may be worthwhile to notify the customer that their subscription will still be charged as we have no means to cancel it.

@roboquat
Copy link
Contributor

LGTM label has been added.

Git tree hash: 42ac6fcc6c88268a670da9bd7992049d64369590

@JanKoehnlein
Copy link
Contributor Author

/approve

@roboquat
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JanKoehnlein, svenefftinge

Associated issue: #4229

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

@roboquat roboquat merged commit b078d3a into main Aug 12, 2021
@roboquat roboquat deleted the jankoehnlein/admin-cannot-delete-4229 branch August 12, 2021 11:05
@JanKoehnlein
Copy link
Contributor Author

@svenefftinge Thanks a lot for the review!

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.

[Admin] Cannot delete account if team subscription slot is assigned
4 participants