-
Notifications
You must be signed in to change notification settings - Fork 12.2k
Open
Description
Description:
When a user is deleted from Rocket.Chat, all of their messages are removed from the rocketchat_message
collection. However, if one of these messages was the last message in a room, the lastMessage
field in the corresponding rocketchat_room
document is not cleaned up.
This results in a ghost message that is only visible on the Android mobile client. The web and desktop clients ignore the dangling lastMessage
pointer.
Steps to reproduce:
- Create a room (e.g.,
#general
). - Post a message in the room as User A.
- Delete User A from the system.
- The message disappears from the
rocketchat_message
collection. - But the room document (
rocketchat_room
) still has the message stored in itslastMessage
field.
- The message disappears from the
- Open the room on the Android mobile app → the ghost message is shown.
- Open the same room in the browser or desktop client → no ghost message is shown.
Expected behavior:
- When a user (and their messages) are deleted, the
lastMessage
field inrocketchat_room
should be cleared or updated to point to the latest valid message. - No ghost messages should appear in any client.
Actual behavior:
- Ghost message still appears in Android mobile client.
- The message is not in
rocketchat_message
anymore. - The room’s
lastMessage
field still references it. - Web and desktop clients do not display it, but Android does.
Server Setup Information:
- Version of Rocket.Chat Server: 7.10.0
- License Type: Community
- Number of Users: 20
- Operating System: Ubuntu 24.04 LTS
- Deployment Method: Docker
- Number of Running Instances: 1
- DB Replicaset Oplog: Disabled
- NodeJS Version: 22.16.0
- MongoDB Version: 6.0.13
Client Setup Information
-
Desktop App or Browser Version: 4.9.0 / Firefox 142.0.1
-
Operating System: Linux, macOS, Windows
-
Mobile App: Android Rocket.Chat app (latest release from Play Store): 4.63.0.96963
Additional context
- The issue only affects mobile clients (tested on multiple Android devices).
- It seems the Android app uses the
lastMessage
field inrocketchat_room
to render channel previews, while web/desktop clients queryrocketchat_message
directly. - Manual workaround:
db.rocketchat_room.updateOne( { _id: "GENERAL" }, { $unset: { lastMessage: "" } } )
Metadata
Metadata
Assignees
Labels
No labels