[web] fix preference of new/old clsiServerId in double-compiles (#34862)

GitOrigin-RevId: 81cbbcec9fef79ebd0c5e7d90048fc4bda302108
This commit is contained in:
Jakob Ackermann
2026-06-23 08:05:42 +00:00
committed by Copybot
parent d75ef19bbf
commit 3be2f320f8
2 changed files with 22 additions and 11 deletions
@@ -618,7 +618,7 @@ async function _makeNewBackendRequest(
response,
body: json,
newCompileBackendClass,
newClsiServerId: clsiServerId || newClsiServerId,
newClsiServerId: newClsiServerId || clsiServerId,
}
}
@@ -86,9 +86,20 @@ describe('ClsiManager', function () {
ok: true,
status: 200,
headers: {
raw: sinon.stub().returns({
'set-cookie': [`${ctx.clsiCookieKey}=${ctx.newClsiServerId}`],
}),
raw: sinon
.stub()
.onFirstCall()
.returns({
'set-cookie': [`${ctx.clsiCookieKey}=${ctx.newClsiServerId}1`],
})
.onSecondCall()
.returns({
'set-cookie': [`${ctx.clsiCookieKey}=${ctx.newClsiServerId}2`],
})
.onThirdCall()
.returns({
'set-cookie': [`${ctx.clsiCookieKey}=${ctx.newClsiServerId}3`],
}),
},
}
@@ -417,7 +428,7 @@ describe('ClsiManager', function () {
ctx.user_id,
'standard',
'c3d',
ctx.newClsiServerId
`${ctx.newClsiServerId}1`
)
})
})
@@ -566,7 +577,7 @@ describe('ClsiManager', function () {
ctx.user_id,
'standard',
'c3d',
ctx.newClsiServerId
`${ctx.newClsiServerId}1`
)
})
})
@@ -614,7 +625,7 @@ describe('ClsiManager', function () {
it('should emit the caching details and stats/timings', function (ctx) {
expect(ctx.result.status).to.equal('success')
expect(ctx.result.clsiServerId).to.equal(ctx.newClsiServerId)
expect(ctx.result.clsiServerId).to.equal(`${ctx.newClsiServerId}1`)
expect(ctx.result.validationError).to.be.undefined
expect(ctx.result.stats).to.deep.equal(ctx.stats)
expect(ctx.result.timings).to.deep.equal(ctx.timings)
@@ -1087,8 +1098,8 @@ describe('ClsiManager', function () {
status: 'success',
compileTime: 1337,
newCompileTime: 1337,
clsiServerId: 'newserver',
newClsiServerId: 'clsi-server-id',
clsiServerId: `${ctx.newClsiServerId}1`,
newClsiServerId: `${ctx.newClsiServerId}2`,
pdfSize: 42,
newPdfSize: 42,
})
@@ -1171,8 +1182,8 @@ describe('ClsiManager', function () {
status: 'success',
compileTime: 1337,
newCompileTime: 1337,
clsiServerId: 'newserver',
newClsiServerId: 'clsi-server-id',
clsiServerId: `${ctx.newClsiServerId}1`,
newClsiServerId: `${ctx.newClsiServerId}2`,
pdfSize: 42,
newPdfSize: 42,
})