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

user deletion #746

Closed
barisusakli opened this issue Jan 9, 2014 · 10 comments
Closed

user deletion #746

barisusakli opened this issue Jan 9, 2014 · 10 comments

Comments

@barisusakli
Copy link
Member

2 buttons in admin/users

  1. Delete -> Deletes the user
  2. Delete and remove content -> Deletes all content and posts.

Things to do for user delete

- delete username from hash username:uid
- delete userslug from hash userslug:uid
- delete email from hash email:uid
- delete uid:<uid>:notifications:read and uid:<uid>:notifications:unread
- delete uid from the sorted sets users:joindate, users:postcount and users:reputation.
- delete uid:<uid>:favourites
- for each cid in categories:cid delete uid from cid:<cid>:active_users
- go through everyone in followers:<uid> and remove uid from following:<theiruid>
- delete followers:<uid> and following:<uid>
- delete user hash user:<uid>
-delete uid:<uid>:chats
-delete uid:<uid>:ip
-delete uid:<uid>:upvote
-delete uid:<uid>:downvote
-remove user from all groups

Things to do for content delete

Go through each pid in uid:<uid>:posts and
- delete set pid:<pid>:users_favourited
- delete pid from users upvotes downvotes
- delete pid from categories:recent_posts:cid:<postCid>
- delete pid from tid:<postTid>:posts
- decrement global postCount
- delete post content from search
- delete hash post:<pid>
- delete pid from posts:pid

Go through each tid in uid:<uid>:topics and

- delete tid:<tid>:followers
- delete tid from topics:tid
- delete tid from topics:recent
- delete tid from topics:posts
- delete tid from topics:views
- delete tid from categories:<topicCid>:tid
- decrement category:<topicCid> field topic_count
- decrement global topicCount
- delete topic title from search
- delete hash topic:<tid>
-delete tid:<tid>:read_by_uid

Delete sorted sets uid:<uid>:topics and uid:<uid>:posts

I may have missed some things to do, I am not sure what to do with chat messages. If we delete a user should we delete his conversations with others? If we don't they will show up as null in other people's chat history.

Also no wonder why our first delete implementation was not complete so much to do 😄

@ghost ghost assigned barisusakli Jan 9, 2014
@psychobunny
Copy link
Contributor

Facebook keeps the chat messages but replaces the name with "A Facebook User"

@akhoury
Copy link
Member

akhoury commented Jan 9, 2014

i dont like the idea of removing all posts, what happens if User A had a long back and forth conversation with User B, on a topic created by User A, then you delete User B with all their posts, then User A looks like loner talking to him/her self.

@akhoury
Copy link
Member

akhoury commented Jan 9, 2014

how about a soft-delete ?

@barisusakli
Copy link
Member Author

I think the sole purpose of deleting content is for removing test users or bots/spammers. I don't think it should be used on real users. What do you mean by a soft-delete?

@julianlam
Copy link
Member

In all cases, we'd just be calling Posts.delete... which doesn't actually "delete" the post, so it's more a toss up between deleting the post or assigning the post's owner to uid 0, or "guest"

@julianlam julianlam modified the milestones: 0.3.2, 0.4.0 Feb 3, 2014
@barisusakli barisusakli modified the milestones: 0.4.0, 0.3.2 Feb 10, 2014
@julianlam julianlam modified the milestones: 0.4.1, 0.4.0 Feb 14, 2014
@bdharrington7
Copy link
Contributor

Assign the post's owner to "user formerly known as X"?

@psychobunny
Copy link
Contributor

Just bumping this issue - we had someone here try and fail to delete a user while DB diving. I think we should definitely implement a "hard delete" (including "hard deleting" posts and topics) for cases like spambots. IMO the ban feature is good enough as a "soft delete"

Adding RFC tag to this, just in case anybody has any opinions on this

@psychobunny
Copy link
Contributor

Just attempting to summarize the important notes from above:

@barisusakli Two Buttons:

2 buttons in admin/users

  • Delete -> Deletes the user
  • Delete and remove content -> Deletes all content and posts.

Button Number 1 - "soft delete" aka BAN - soft deletes user; any post by that user will look similar to this:

@psychobunny:

Facebook keeps the chat messages but replaces the name with "A Facebook User"

this is in order to prevent this problem:

@akhoury:

i dont like the idea of removing all posts, what happens if User A had a long back and forth conversation with User B, on a topic created by User A, then you delete User B with all their posts, then User A looks like loner talking to him/her self.

Button Number 2 - just hard deletes all topics & posts referenced by that user. I think for now we can forget about adjusting stuff like up/downvotes etc, because that may be too much work on server. This is for potential spambots or test users, we don't need this cluttering our DB for no reason.

@preeefix
Copy link
Contributor

(Been a while since I've commented on this project)
@psychobunny

I think for now we can forget about adjusting stuff like up/downvotes etc, because that may be too much work on server.

Since we're server side, why not schedule this for when the CPU usage is below a threshold?

barisusakli added a commit that referenced this issue Mar 14, 2014
user deletion NOT SKALABLE
@markus101
Copy link

Currently using Vanilla Forums, when I go to delete a user I'm presented with 3 options:

  • Keep User Content - Delete the user but keep the user's content.
  • Blank User Content - Delete the user and replace all of the user's content with a message stating the user has been deleted. This gives a visual cue that there is missing information.
  • Remove User Content - Delete the user and completely remove all of the user's content. This may cause discussions to be disjointed. Best option for removing spam.

I use option 3 all the time to clean up when a spammer gets in and posts, just thing morning I had multiple pages of spam from two users that I cleaned up by deleting them and their content. Not being able to quickly clean up spam that gets past any filters would be an issue for me and my community.

I understand the issue with hard deleting a user and their posts, but spammers can and will get in and being able to quickly and simply remove them and their content is very important.

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

No branches or pull requests

7 participants