From 93526bec969bd7bb6b86fedd8cf3812ab16eadcc Mon Sep 17 00:00:00 2001 From: Jakob Ackermann Date: Mon, 20 Oct 2025 15:44:15 +0200 Subject: [PATCH] [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 --------- Co-authored-by: Mathias Jakobsen GitOrigin-RevId: 749a7a1c3b21ef2e46bc86a74631e004069c5806 --- .../app/src/Features/Compile/ClsiCacheManager.js | 9 ++++++++- .../app/src/Features/Compile/CompileController.mjs | 13 ++++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/services/web/app/src/Features/Compile/ClsiCacheManager.js b/services/web/app/src/Features/Compile/ClsiCacheManager.js index 0c172642ee..d6594abf34 100644 --- a/services/web/app/src/Features/Compile/ClsiCacheManager.js +++ b/services/web/app/src/Features/Compile/ClsiCacheManager.js @@ -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 diff --git a/services/web/app/src/Features/Compile/CompileController.mjs b/services/web/app/src/Features/Compile/CompileController.mjs index 56674feaec..cc6fc79b9f 100644 --- a/services/web/app/src/Features/Compile/CompileController.mjs +++ b/services/web/app/src/Features/Compile/CompileController.mjs @@ -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) {