diff --git a/services/web/app/src/Features/History/RestoreManager.js b/services/web/app/src/Features/History/RestoreManager.js index 0d3e96b97f..16ef2024f6 100644 --- a/services/web/app/src/Features/History/RestoreManager.js +++ b/services/web/app/src/Features/History/RestoreManager.js @@ -207,6 +207,7 @@ const RestoreManager = { continue } // We have a new id for this comment thread + comment.id = result.duplicateId comment.op.t = result.duplicateId } newRanges.comments.push(comment) diff --git a/services/web/test/unit/src/History/RestoreManagerTests.js b/services/web/test/unit/src/History/RestoreManagerTests.js index a22793de85..f76ba506ad 100644 --- a/services/web/test/unit/src/History/RestoreManagerTests.js +++ b/services/web/test/unit/src/History/RestoreManagerTests.js @@ -266,13 +266,28 @@ describe('RestoreManager', function () { beforeEach(function () { this.pathname = 'foo.tex' this.comments = [ - { op: { t: 'comment-in-other-doc', p: 0, c: 'foo' } }, - { op: { t: 'single-comment', p: 10, c: 'bar' } }, - { op: { t: 'deleted-comment', p: 20, c: 'baz' } }, + { + id: 'comment-in-other-doc', + op: { t: 'comment-in-other-doc', p: 0, c: 'foo' }, + }, + { + id: 'single-comment', + op: { t: 'single-comment', p: 10, c: 'bar' }, + }, + { + id: 'deleted-comment', + op: { t: 'deleted-comment', p: 20, c: 'baz' }, + }, ] this.remappedComments = [ - { op: { t: 'duplicate-comment', p: 0, c: 'foo' } }, - { op: { t: 'single-comment', p: 10, c: 'bar' } }, + { + id: 'duplicate-comment', + op: { t: 'duplicate-comment', p: 0, c: 'foo' }, + }, + { + id: 'single-comment', + op: { t: 'single-comment', p: 10, c: 'bar' }, + }, ] this.ProjectLocator.promises.findElementByPath = sinon.stub().rejects() this.DocstoreManager.promises.getCommentThreadIds = sinon