diff --git a/services/web/app/src/Features/Compile/ClsiCookieManager.mjs b/services/web/app/src/Features/Compile/ClsiCookieManager.mjs index 7ccb1c9ba3..0cd3221d28 100644 --- a/services/web/app/src/Features/Compile/ClsiCookieManager.mjs +++ b/services/web/app/src/Features/Compile/ClsiCookieManager.mjs @@ -34,14 +34,6 @@ const ClsiCookieManagerFactory = function (backendGroup) { } } - function buildOldKey(projectId, userId) { - if (backendGroup != null) { - return `clsiserver:${backendGroup}:${projectId}:${userId}` - } else { - return `clsiserver:${projectId}:${userId}` - } - } - async function getServerId( projectId, userId, @@ -51,14 +43,9 @@ const ClsiCookieManagerFactory = function (backendGroup) { if (!clsiCookiesEnabled) { return } - let serverId = await rclient.get( + const serverId = await rclient.get( buildKey(projectId, userId, compileBackendClass) ) - if (!serverId) { - // Fallback to the old key. - // TODO(das7pad): remove this in 24h. - serverId = await rclient.get(buildOldKey(projectId, userId)) - } if (!serverId) { return await cookieManager.promises._populateServerIdViaRequest( @@ -229,10 +216,7 @@ const ClsiCookieManagerFactory = function (backendGroup) { return } try { - await rclient.del( - buildKey(projectId, userId, compileBackendClass), - buildOldKey(projectId, userId) - ) + await rclient.del(buildKey(projectId, userId, compileBackendClass)) } catch (err) { // redis errors need wrapping as the instance may be shared throw new OError( diff --git a/services/web/test/unit/src/Compile/ClsiCookieManager.test.mjs b/services/web/test/unit/src/Compile/ClsiCookieManager.test.mjs index f9485fd137..2e7963c326 100644 --- a/services/web/test/unit/src/Compile/ClsiCookieManager.test.mjs +++ b/services/web/test/unit/src/Compile/ClsiCookieManager.test.mjs @@ -63,28 +63,6 @@ describe('ClsiCookieManager', function () { serverId.should.equal('clsi-7') }) - it('should fallback to old key', async function (ctx) { - ctx.redis.get - .withArgs(`clsiserver:c3d:${ctx.project_id}:${ctx.user_id}`) - .resolves(null) - ctx.redis.get - .withArgs(`clsiserver:${ctx.project_id}:${ctx.user_id}`) - .resolves('clsi-7') - const serverId = await ctx.ClsiCookieManager.promises.getServerId( - ctx.project_id, - ctx.user_id, - '', - 'c3d' - ) - ctx.redis.get - .calledWith(`clsiserver:c3d:${ctx.project_id}:${ctx.user_id}`) - .should.equal(true) - ctx.redis.get - .calledWith(`clsiserver:${ctx.project_id}:${ctx.user_id}`) - .should.equal(true) - serverId.should.equal('clsi-7') - }) - it('should _populateServerIdViaRequest if no key is found', async function (ctx) { ctx.ClsiCookieManager.promises._populateServerIdViaRequest = sinon .stub() @@ -185,15 +163,14 @@ describe('ClsiCookieManager', function () { }) describe('clearServerId', function () { - it('should clear both keys', async function (ctx) { + it('should clear the key', async function (ctx) { await ctx.ClsiCookieManager.promises.clearServerId( ctx.project_id, ctx.user_id, 'c3d' ) ctx.redis.del.should.have.been.calledWith( - `clsiserver:c3d:${ctx.project_id}:${ctx.user_id}`, - `clsiserver:${ctx.project_id}:${ctx.user_id}` + `clsiserver:c3d:${ctx.project_id}:${ctx.user_id}` ) }) })