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

Messages deleted using "_hidden":true are not marked as deleted/are not ignored during migration #34

Open
drygdryg opened this issue Aug 5, 2024 · 1 comment

Comments

@drygdryg
Copy link
Contributor

drygdryg commented Aug 5, 2024

Rocket.Chat in some cases sets the "_hidden":true" property instead of deleting a message from MongoDB, which leads to inclusion of such messages in the mongoexport.
The proof of this behavior in the Rocket.Chat server side source code: https://github.com/RocketChat/Rocket.Chat/blob/41b1407804ce17bb54b79cda607554c474246f29/apps/meteor/app/lib/server/functions/deleteMessage.ts#L56

The main point is that we cannot just ignore such messages when migrating, in case the message is the beginning of the thread.
A possible solution is to migrate the message and then delete it, if the _hidden flag is set. This will allow us to save threads that started with a deleted message.

@drygdryg drygdryg changed the title Messages deleted using the _hidden=true are not marked as deleted/are not ignored during migration Messages deleted using "_hidden":true are not marked as deleted/are not ignored during migration Aug 5, 2024
@drygdryg
Copy link
Contributor Author

drygdryg commented Aug 6, 2024

A possible solution is to migrate the message and then delete it, if the _hidden flag is set. This will allow us to save threads that started with a deleted message.

This will not work as required because Rocket.Chat, when deleting a message, adds t: 'rm' to the original MongoDB document and then creates a copy of it setting _hidden: true.
We probably need to process messages with type "rm" and ignore messages with _hidden. And after all the messages have been migrated, we need to run an iteration and delete all messages with the "rm" type using the Matrix redact event.

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

No branches or pull requests

1 participant