Open drygdryg opened 1 month ago
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.
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#L56The 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.