RocketChat / RocketChat/Rocket.Chat

[bug] Message Erasure Type `Keep Messages And User Name` not work as expected

Open
#23,896 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
46.1k
Forks
13.9k
Avg merge
3d 3h
Merged PRs (30d)
130

Description

Description:

In Admin UI - Message we have Message Erasure Type option.
Default is Delete All Messages
But if you set Keep Messages And User Name - you get same behavior and Delete All Messages set - all users messages are deleted.

Steps to reproduce:
  1. Set Keep Messages And User Name value in Admin UI - Message
  2. Delete user that had messages in DM and other chats
  3. No messages of deleted user remain
Expected behavior:

User account should be deleted, but messages in chat history should remain and be authored as deleted user (when that user was on server, for example UserA @usera)

Actual behavior:

image

Server Setup Information:
  • Version of Rocket.Chat Server: 4.2.0
  • Operating System: CentOS7
  • Deployment Method: docker
  • Number of Running Instances: 10
  • DB Replicaset Oplog: Enabled
  • NodeJS Version: 12.22.1
  • MongoDB Version: 4.2.17
Client Setup Information
  • Desktop App or Browser Version: Chrome 96
  • Operating System: Windows 10
Additional context

Tested on 3.18.3 with same result

Third option look like work fine
image

Relevant logs:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the Admin UI Message Erasure Type setting and follow the user deletion flow described in the reproduction steps. Reproduce the Keep Messages And User Name case, compare it with Delete All Messages and the third option, and consider the issue done when deleted users' messages remain attributed to the deleted user while the account is removed.

Written by the indexing model from the issue text.

Assessment

Tech stack
mongodb, typescript
Domain
backend, database
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.