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

Deleting users which are referenced in models, groups, or chats leaves system in a bad state #194

Closed
toebes opened this issue Jan 30, 2021 · 5 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@toebes
Copy link

toebes commented Jan 30, 2021

Versions

  • Convergence Version: 1.0.0-rc.7
  • OS: Linux
  • Browser: chrome

Describe the Bug
Deleting a user which is still in use for permissions on a model leaves the model permissions in a bad state

Step To Reproduce

  1. Create a user (I called it AAADONOTUSE)
  2. Select any model and add that user with read permission to the model
  3. Go back to the user admin and delete that user
  4. Go back to the model and you see that the user name that previously said AAADONOTUSE shows up as a series of somewhat random characters. In this case it is BbEL9za/OIz++Tiuib56MVaIKTbacJy5hlff

Note that you can't delete that user permission (405 method not allowed, which I suspect is because of the random / in the name)

Expected Behavior
I would have expected that either

  • You aren't allowed to delete the user which exists on permissions (preferable) or
  • The user should be removed from the permissions automatically.
@toebes toebes added the bug Something isn't working label Jan 30, 2021
@mmacfadden
Copy link
Contributor

I have verified this bug. This actually applies to the entire permissions system not just the models. Essentially what is happening now is the following.

Because several records in the database point to the user, when the user is deleted the user record is not actually removed from the database. Rather we change their username to a random set of characters and then mark them as deleted.

What we are not doing is removing them from the permissions in the system.

@mmacfadden mmacfadden self-assigned this May 8, 2021
@mmacfadden mmacfadden added this to the 1.0.0-rc.8 milestone May 8, 2021
@mmacfadden
Copy link
Contributor

This is being worked now. We have a fix implemented and it is being tested. This will make it into 1.0.0-rc.8.

@toebes
Copy link
Author

toebes commented May 8, 2021

It would be nice if deleted users didn't show up when listing the users. I'm fine with them staying in the database, but if you know that it is a deleted user... then just don't show it.

@mmacfadden
Copy link
Contributor

The deleted user's do not show up in the system (when there are no bugs). The issue is just that their permission records were not deleted correctly. Once that is fixed they will not show up. Which is what I am working on as we speak.

@mmacfadden mmacfadden modified the milestones: 1.0.0-rc.8, 1.0.0-rc.9 May 8, 2021
@mmacfadden mmacfadden changed the title Deleting users which are used in permissions leaves system in a bad state Deleting users which are used in permissions, groups, or chats leaves system in a bad state May 8, 2021
@mmacfadden mmacfadden changed the title Deleting users which are used in permissions, groups, or chats leaves system in a bad state Deleting users which are referenced in models, groups, or chats leaves system in a bad state May 8, 2021
@toebes
Copy link
Author

toebes commented May 9, 2021

This is great to hear!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants