[web] pre-populate clsi-cache ahead of showing survey (#29221)

* [web] pre-populate clsi-cache ahead of showing survey

* [web] tweak variant checks

Co-authored-by: Mathias Jakobsen <mathias.jakobsen@overleaf.com>

---------

Co-authored-by: Mathias Jakobsen <mathias.jakobsen@overleaf.com>
GitOrigin-RevId: 749a7a1c3b21ef2e46bc86a74631e004069c5806
This commit is contained in:
Jakob Ackermann
2025-10-20 15:44:15 +02:00
committed by Copybot
parent db1966b0aa
commit 93526bec96
2 changed files with 20 additions and 2 deletions

View File

@@ -172,7 +172,14 @@ async function prepareClsiCache(
userId,
'populate-clsi-cache'
)
if (variant !== 'enabled') return
if (variant !== 'enabled') {
// Pre-populate the cache for the users in the split-test for prompts.
const { variant } = await SplitTestHandler.promises.getAssignmentForUser(
userId,
'populate-clsi-cache-for-prompt'
)
if (variant !== 'enabled') return
}
const features = await UserGetter.promises.getUserFeatures(userId)
if (features.compileGroup !== 'priority') return

View File

@@ -73,9 +73,20 @@ async function _getSplitTestOptions(req, res) {
res,
'populate-clsi-cache'
)
const populateClsiCache = populateClsiCacheVariant === 'enabled'
let populateClsiCache = populateClsiCacheVariant === 'enabled'
const compileFromClsiCache = populateClsiCache // use same split-test
if (!populateClsiCache) {
// Pre-populate the cache for the users in the split-test for prompts.
// Keep the compile from cache disabled for now.
const { variant } = await SplitTestHandler.promises.getAssignment(
editorReq,
res,
'populate-clsi-cache-for-prompt'
)
populateClsiCache = variant === 'enabled'
}
const pdfDownloadDomain = Settings.pdfDownloadDomain
if (!req.query.enable_pdf_caching) {