flowfuse icon indicating copy to clipboard operation
flowfuse copied to clipboard

Delete Account with Team Deletion

Open joepavitt opened this issue 1 year ago • 6 comments

Description

When deleting an account, users need to delete their team first. Whilst prompted, the settings for this are in a different place and not intuitive path to go between these locations.

If I am the only member of a team, that team has no instances, and I choose to delete my account - it should deleted both my account and my team in one hit.

Which customers would this be available to

None

Have you provided an initial effort estimate for this issue?

I have provided an initial effort estimate

joepavitt avatar Jul 31 '24 12:07 joepavitt

@joepavitt, if the user trying to delete the team is the only owner but the team has other members, should we proceed with the team deletion?

cstns avatar Aug 08 '24 12:08 cstns

Good question - @knolleary - thoughts? I'd probably go with "no", as they're the kind of teams we want reaching out to us so that we can understand why they're churned

joepavitt avatar Aug 08 '24 12:08 joepavitt

I'd stick with only deleting if they are the last person in the team.

knolleary avatar Aug 08 '24 12:08 knolleary

OK, sound's good!

Should I also check for device presence?

cstns avatar Aug 08 '24 12:08 cstns

Looking at the current implementation, we're iterating over the teams the user is a single owner of.

Let's say the user deleting his account is the owner of multiple teams and we try to delete them all. We don't encounter any problems with the first team, but for the 2'nd lets say we find out that it still has an instance assigned and throw an error.

Is the beforeDestroy hook in the modal transactional? We might find ourselves in situations where we delete just a single team then prompt the user with an error and he'll find himself in with a missing team in the case the hook isn't transactional.

Should we consider these scenarios?

cstns avatar Aug 08 '24 12:08 cstns

@cstns two options:

  • We do a sanity check first to see which teams can be deleted, then delete if they all can
  • As you've said, delete what we can, don't delete the full account, and then flag the remaining teams need to be dealt with.

The first option is the "proper" way imo

joepavitt avatar Aug 08 '24 16:08 joepavitt

I'm reverting the PR that fixes this as it introduced a bug that left teams orphaned with active stripe subscriptions. I'm out of time to fix today, so reverting to prevent it happening further over the weekend. Will rework the original PR on Monday.

knolleary avatar Sep 20 '24 16:09 knolleary

The original fix has been reapplied with the additional fixes - https://github.com/FlowFuse/flowfuse/pull/4531

knolleary avatar Sep 24 '24 10:09 knolleary