Revert "Send operations to project-history when deleting comments (#17198)" (#17476)

This reverts commit 34ab7e4ea6dd1b5fd749f9accaf4a6e16ae1d840.

GitOrigin-RevId: 005de52bcacbacf62d22cd8617d7a765f56bd72e
This commit is contained in:
Domagoj Kriskovic
2024-03-08 16:17:16 +01:00
committed by Copybot
parent 1ef205c094
commit 03616a802e
8 changed files with 18 additions and 125 deletions
@@ -11,7 +11,6 @@ describe('HttpController', function () {
'./HistoryManager': (this.HistoryManager = {
flushProjectChangesAsync: sinon.stub(),
}),
'./ProjectHistoryRedisManager': (this.ProjectHistoryRedisManager = {}),
'./ProjectManager': (this.ProjectManager = {}),
'./ProjectFlusher': { flushAllProjects() {} },
'./DeleteQueueManager': (this.DeleteQueueManager = {}),
@@ -652,7 +651,6 @@ describe('HttpController', function () {
describe('deleteComment', function () {
beforeEach(function () {
this.user_id = 'user-id-123'
this.req = {
params: {
project_id: this.project_id,
@@ -660,9 +658,7 @@ describe('HttpController', function () {
comment_id: (this.comment_id = 'mock-comment-id'),
},
query: {},
body: {
user_id: this.user_id,
},
body: {},
}
})
@@ -670,20 +666,13 @@ describe('HttpController', function () {
beforeEach(function () {
this.DocumentManager.deleteCommentWithLock = sinon
.stub()
.callsArgWith(4)
this.ProjectHistoryRedisManager.queueOps = sinon.stub()
.callsArgWith(3)
this.HttpController.deleteComment(this.req, this.res, this.next)
})
it('should accept the change', function () {
this.DocumentManager.deleteCommentWithLock
.calledWith(
this.project_id,
this.doc_id,
this.comment_id,
this.user_id
)
.calledWith(this.project_id, this.doc_id, this.comment_id)
.should.equal(true)
})
@@ -713,7 +702,7 @@ describe('HttpController', function () {
beforeEach(function () {
this.DocumentManager.deleteCommentWithLock = sinon
.stub()
.callsArgWith(4, new Error('oops'))
.callsArgWith(3, new Error('oops'))
this.HttpController.deleteComment(this.req, this.res, this.next)
})