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

Proper user deletion / organization leaving #3460

Merged
merged 7 commits into from
Dec 20, 2024
Merged

Conversation

pablonyx
Copy link
Contributor

@pablonyx pablonyx commented Dec 14, 2024

Description

Allow any admin to leave their organization (in multi tenant case only)
Note that this will prevent them from creating a new instance if they were the owner of a previous one (intentional, but perhaps not the flow we want).

How Has This Been Tested?

  • Create and try to leave as invited tenant in single-tenant + multi tenant case
  • Should not be possible in single tenant case

Accepted Risk (provide if relevant)

Tested running multi tenant locally and

  • Leaving as single admin user
  • Leaving as admin user among admin users (other admin users should still persist)
  • Leaving as admin user with basic users (users should create new organization next time they log in)

Related Issue(s) (provide if relevant)

N/A

Mental Checklist:

  • All of the automated tests pass
  • All PR comments are addressed and marked resolved
  • If there are migrations, they have been rebased to latest main
  • If there are new dependencies, they are added to the requirements
  • If there are new environment variables, they are added to all of the deployment methods
  • If there are new APIs that don't require auth, they are added to PUBLIC_ENDPOINT_SPECS
  • Docker images build and basic functionalities work
  • Author has done a final read through of the PR right before merge

Backporting (check the box to trigger backport action)

Note: You have to check that the action passes, otherwise resolve the conflicts manually and tag the patches.

  • This PR should be backported (make sure to check that the backport attempt succeeds)

Copy link

vercel bot commented Dec 14, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
internal-search ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 20, 2024 8:30pm

user_to_delete: User,
db_session: Session,
) -> None:
for oauth_account in user_to_delete.oauth_accounts:
Copy link
Contributor

Choose a reason for hiding this comment

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

deleting users is often kind of tricky, we need to delete everything related to that user no? Like chat sessions, files in the blob store, etc?

@pablonyx pablonyx force-pushed the feat/proper_user_leave branch from 9be3690 to 00d7ba0 Compare December 20, 2024 20:26
@pablonyx pablonyx enabled auto-merge December 20, 2024 20:26
@pablonyx pablonyx added this pull request to the merge queue Dec 20, 2024
Merged via the queue into main with commit 4e2c90f Dec 20, 2024
13 checks passed
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.

2 participants