Просмотр исходного кода

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
Jakob Ackermann 5 лет назад
Родитель
Сommit
3e3d683a2f

+ 14 - 26
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 (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
-              )
+        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 }
             )
-          }
-          callback()
-        })
+          )
+        }
+        callback()
       })
     })
   },

+ 0 - 7
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)
       })