Preserve resolve state in history on file restore (#26302)

* Preserve resolve state in history when doing a restore

* added comment why is resovled property deleted

GitOrigin-RevId: fb1011cf98a658b302c6eef1da83fb1006bb2052
This commit is contained in:
Domagoj Kriskovic
2025-06-12 15:36:52 +02:00
committed by Copybot
parent 9c287ba36c
commit fd1926a1c8
2 changed files with 3 additions and 2 deletions
+3
View File
@@ -53,6 +53,9 @@ module.exports = RangeManager = {
if ((comment.op != null ? comment.op.t : undefined) != null) {
comment.op.t = RangeManager._safeObjectId(comment.op.t)
}
// resolved property is added to comments when they are obtained from history, but this state doesn't belong in mongo docs collection
// more info: https://github.com/overleaf/internal/issues/24371#issuecomment-2913095174
delete comment.op?.resolved
updateMetadata(comment.metadata)
}
return ranges
@@ -231,8 +231,6 @@ const RestoreManager = {
delete threadData.resolved_by_user_id
delete threadData.resolved_at
}
// remove the resolved property from the comment range as the chat service is synced at this point
delete commentRange.op.resolved
}
await ChatManager.promises.injectUserInfoIntoThreads(newCommentThreadData)