From 3e3d683a2f28401cf5bde88861ce62d0a839df12 Mon Sep 17 00:00:00 2001 From: Jakob Ackermann Date: Thu, 7 Jan 2021 14:17:10 +0000 Subject: [PATCH] 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 --- .../app/src/Features/Compile/ClsiManager.js | 40 +++++++------------ .../test/unit/src/Compile/ClsiManagerTests.js | 7 ---- 2 files changed, 14 insertions(+), 33 deletions(-) diff --git a/services/web/app/src/Features/Compile/ClsiManager.js b/services/web/app/src/Features/Compile/ClsiManager.js index 59fb34ef2d..5e50f9e2b4 100644 --- a/services/web/app/src/Features/Compile/ClsiManager.js +++ b/services/web/app/src/Features/Compile/ClsiManager.js @@ -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() }) }) }, diff --git a/services/web/test/unit/src/Compile/ClsiManagerTests.js b/services/web/test/unit/src/Compile/ClsiManagerTests.js index e38da5773a..3b32d31272 100644 --- a/services/web/test/unit/src/Compile/ClsiManagerTests.js +++ b/services/web/test/unit/src/Compile/ClsiManagerTests.js @@ -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) })