From 3a206074f2b5b726107cfbbf451ca18b1006404f Mon Sep 17 00:00:00 2001 From: Jakob Ackermann Date: Fri, 31 Oct 2025 09:36:47 +0100 Subject: [PATCH] [web] move premium compiles up one bracket (#29410) GitOrigin-RevId: 53423f855b2c215f6cc926b480422b2ce3477a74 --- .../web/app/src/Features/Compile/ClsiManager.mjs | 2 ++ .../src/Features/Compile/CompileController.mjs | 7 +------ .../app/src/Features/Compile/CompileManager.mjs | 2 +- .../test/unit/src/Compile/ClsiManager.test.mjs | 16 ++++++++-------- .../unit/src/Compile/CompileController.test.mjs | 4 ++-- .../unit/src/Compile/CompileManager.test.mjs | 4 ++-- 6 files changed, 16 insertions(+), 19 deletions(-) diff --git a/services/web/app/src/Features/Compile/ClsiManager.mjs b/services/web/app/src/Features/Compile/ClsiManager.mjs index be94e70785..f1030cf6b1 100644 --- a/services/web/app/src/Features/Compile/ClsiManager.mjs +++ b/services/web/app/src/Features/Compile/ClsiManager.mjs @@ -52,6 +52,8 @@ function getNewCompileBackendClass(projectId, compileBackendClass) { return 'n4' case 'c2d': return 'n4' + case 'c4d': + return 'n4' default: throw new Error('unknown ?compileBackendClass') } diff --git a/services/web/app/src/Features/Compile/CompileController.mjs b/services/web/app/src/Features/Compile/CompileController.mjs index 6e8675843c..b628b401db 100644 --- a/services/web/app/src/Features/Compile/CompileController.mjs +++ b/services/web/app/src/Features/Compile/CompileController.mjs @@ -279,12 +279,7 @@ const _CompileController = { status, compileTime: timings?.compileE2E, timeout: limits.timeout, - server: - clsiServerId?.includes('-c2d-') || - clsiServerId?.includes('-c3d-') || - clsiServerId?.includes('-c4d-') - ? 'faster' - : 'normal', + server: clsiServerId?.includes('-c4d-') ? 'faster' : 'normal', clsiServerId, isAutoCompile, isInitialCompile: stats?.isInitialCompile === 1, diff --git a/services/web/app/src/Features/Compile/CompileManager.mjs b/services/web/app/src/Features/Compile/CompileManager.mjs index 9b0183c94c..c1a80a6f41 100644 --- a/services/web/app/src/Features/Compile/CompileManager.mjs +++ b/services/web/app/src/Features/Compile/CompileManager.mjs @@ -135,7 +135,7 @@ async function _getProjectCompileLimits(project) { timeout: ownerFeatures.compileTimeout || Settings.defaultFeatures.compileTimeout, compileGroup, - compileBackendClass: compileGroup === 'standard' ? 'n2d' : 'c2d', + compileBackendClass: compileGroup === 'standard' ? 'n2d' : 'c4d', ownerAnalyticsId: analyticsId, } return limits diff --git a/services/web/test/unit/src/Compile/ClsiManager.test.mjs b/services/web/test/unit/src/Compile/ClsiManager.test.mjs index e01aac593c..2b8fa3bac8 100644 --- a/services/web/test/unit/src/Compile/ClsiManager.test.mjs +++ b/services/web/test/unit/src/Compile/ClsiManager.test.mjs @@ -852,7 +852,7 @@ describe('ClsiManager', function () { ctx.project._id, ctx.user_id, { - compileBackendClass: 'c2d', + compileBackendClass: 'c4d', compileGroup: 'priority', } ) @@ -868,7 +868,7 @@ describe('ClsiManager', function () { url.host === CLSI_HOST && url.pathname === `/project/${ctx.project._id}/user/${ctx.user_id}/compile` && - url.searchParams.get('compileBackendClass') === 'c2d' && + url.searchParams.get('compileBackendClass') === 'c4d' && url.searchParams.get('compileGroup') === 'priority' ) ) @@ -885,7 +885,7 @@ describe('ClsiManager', function () { ctx.AnalyticsManager.recordEventForUserInBackground ).to.have.been.calledWith(ctx.user_id, 'double-compile-result', { projectId: 'project-id', - compileBackendClass: 'c2d', + compileBackendClass: 'c4d', newCompileBackendClass: 'n4', status: 'success', compileTime: 1337, @@ -1055,7 +1055,7 @@ describe('ClsiManager', function () { await ctx.ClsiManager.promises.deleteAuxFiles( ctx.project._id, ctx.user_id, - { compileBackendClass: 'c2d', compileGroup: 'priority' }, + { compileBackendClass: 'c4d', compileGroup: 'priority' }, 'node-1' ) // wait for the background task to finish @@ -1065,7 +1065,7 @@ describe('ClsiManager', function () { it('should clear both cookies', function (ctx) { expect( ctx.ClsiCookieManager.promises.clearServerId - ).to.have.been.calledWith(ctx.project._id, ctx.user_id, 'c2d') + ).to.have.been.calledWith(ctx.project._id, ctx.user_id, 'c4d') expect( ctx.ClsiCookieManager.promises.clearServerId ).to.have.been.calledWith(ctx.project._id, ctx.user_id, 'n4') @@ -1078,7 +1078,7 @@ describe('ClsiManager', function () { url.host === CLSI_HOST && url.pathname === `/project/${ctx.project._id}/user/${ctx.user_id}` && - url.searchParams.get('compileBackendClass') === 'c2d' && + url.searchParams.get('compileBackendClass') === 'c4d' && url.searchParams.get('compileGroup') === 'priority' && url.searchParams.get('clsiserverid') === 'node-1' ), @@ -1168,7 +1168,7 @@ describe('ClsiManager', function () { ctx.project._id, ctx.user_id, false, - { compileBackendClass: 'c2d', compileGroup: 'priority' }, + { compileBackendClass: 'c4d', compileGroup: 'priority' }, 'node-1' ) // wait for the background task to finish @@ -1180,7 +1180,7 @@ describe('ClsiManager', function () { sinon.match( url => url.toString() === - `http://clsi.example.com/project/${ctx.project._id}/user/${ctx.user_id}/wordcount?compileBackendClass=c2d&compileGroup=priority&file=main.tex&image=mock-image-name&clsiserverid=node-1` + `http://clsi.example.com/project/${ctx.project._id}/user/${ctx.user_id}/wordcount?compileBackendClass=c4d&compileGroup=priority&file=main.tex&image=mock-image-name&clsiserverid=node-1` ) ) expect(ctx.FetchUtils.fetchStringWithResponse).to.have.been.calledWith( diff --git a/services/web/test/unit/src/Compile/CompileController.test.mjs b/services/web/test/unit/src/Compile/CompileController.test.mjs index fda3f211fd..07c75ba70c 100644 --- a/services/web/test/unit/src/Compile/CompileController.test.mjs +++ b/services/web/test/unit/src/Compile/CompileController.test.mjs @@ -783,7 +783,7 @@ describe('CompileController', function () { .stub() .resolves({ compileGroup: 'priority', - compileBackendClass: 'c2d', + compileBackendClass: 'c4d', }) await ctx.CompileController._proxyToClsi( ctx.projectId, @@ -798,7 +798,7 @@ describe('CompileController', function () { it('should open a request to the CLSI', function (ctx) { ctx.fetchUtils.fetchStreamWithResponse.should.have.been.calledWith( - `${ctx.settings.apis.clsi.url}${ctx.url}?compileGroup=priority&compileBackendClass=c2d` + `${ctx.settings.apis.clsi.url}${ctx.url}?compileGroup=priority&compileBackendClass=c4d` ) }) }) diff --git a/services/web/test/unit/src/Compile/CompileManager.test.mjs b/services/web/test/unit/src/Compile/CompileManager.test.mjs index 35cb3b1d85..4949da5fbf 100644 --- a/services/web/test/unit/src/Compile/CompileManager.test.mjs +++ b/services/web/test/unit/src/Compile/CompileManager.test.mjs @@ -254,7 +254,7 @@ describe('CompileManager', function () { .calledWith(null, { timeout: ctx.timeout, compileGroup: ctx.group, - compileBackendClass: 'c2d', + compileBackendClass: 'c4d', ownerAnalyticsId: 'abc', }) .should.equal(true) @@ -284,7 +284,7 @@ describe('CompileManager', function () { await ctx.CompileManager.promises.getProjectCompileLimits( ctx.project_id ) - expect(compileBackendClass).to.equal('c2d') + expect(compileBackendClass).to.equal('c4d') }) }) })