Merge pull request #3545 from overleaf/revert-3517-jpa-clear-clsi-persistance

Revert "[ClsiManager] clear the clsi persistence when clearing the cache"

GitOrigin-RevId: fbaeff527f69526da1bfc32de37bbdf6081bcd23
This commit is contained in:
Jakob Ackermann 2021-01-07 14:17:10 +00:00 committed by Copybot
parent 00ba2d95c7
commit 3e3d683a2f
2 changed files with 14 additions and 33 deletions

View file

@ -153,33 +153,21 @@ const ClsiManager = {
// always clear the project state from the docupdater, even if there
// was a problem with the request to the clsi
DocumentUpdaterHandler.clearProjectState(projectId, docUpdaterErr => {
ClsiCookieManager.clearServerId(projectId, redisError => {
if (clsiErr) {
return callback(
OError.tag(clsiErr, 'Failed to delete aux files', { projectId })
if (clsiErr != null) {
return callback(
OError.tag(clsiErr, 'Failed to delete aux files', { projectId })
)
}
if (docUpdaterErr != null) {
return callback(
OError.tag(
docUpdaterErr,
'Failed to clear project state in doc updater',
{ projectId }
)
}
if (docUpdaterErr) {
return callback(
OError.tag(
docUpdaterErr,
'Failed to clear project state in doc updater',
{ projectId }
)
)
}
if (redisError) {
// redis errors need wrapping as the instance may be shared
return callback(
OError(
'Failed to clear clsi persistence',
{ projectId },
redisError
)
)
}
callback()
})
)
}
callback()
})
})
},

View file

@ -8,7 +8,6 @@ describe('ClsiManager', function() {
beforeEach(function() {
this.jar = { cookie: 'stuff' }
this.ClsiCookieManager = {
clearServerId: sinon.stub().yields(),
getCookieJar: sinon.stub().callsArgWith(1, null, this.jar),
setServerId: sinon.stub().callsArgWith(2),
_getServerId: sinon.stub()
@ -421,12 +420,6 @@ describe('ClsiManager', function() {
.should.equal(true)
})
it('should clear the clsi persistance', function() {
this.ClsiCookieManager.clearServerId
.calledWith(this.project_id)
.should.equal(true)
})
it('should call the callback', function() {
this.callback.called.should.equal(true)
})