Sfoglia il codice sorgente

[web] settle on a single split-test for the clsi-cache rollout (#25399)

* [web] settle on a single split-test for the clsi-cache rollout

Use the split-test that was used for rolling out the writes so that we
can use their already populated caches.

* [clsi-cache] fix non-sharded clsi-cache in dev-env

GitOrigin-RevId: 6ebd6369183342fe6d5e325b760d011fd1d57516
Jakob Ackermann 1 anno fa
parent
commit
b3a1341545

+ 1 - 7
services/web/app/src/Features/Compile/CompileController.js

@@ -72,13 +72,6 @@ async function _getSplitTestOptions(req, res) {
   // Lookup the clsi-cache flag in the backend.
   // We may need to turn off the feature on a short notice, without requiring
   //  all users to reload their editor page to disable the feature.
-  const { variant: compileFromClsiCacheVariant } =
-    await SplitTestHandler.promises.getAssignment(
-      editorReq,
-      res,
-      'compile-from-clsi-cache'
-    )
-  const compileFromClsiCache = compileFromClsiCacheVariant === 'enabled'
   const { variant: populateClsiCacheVariant } =
     await SplitTestHandler.promises.getAssignment(
       editorReq,
@@ -86,6 +79,7 @@ async function _getSplitTestOptions(req, res) {
       'populate-clsi-cache'
     )
   const populateClsiCache = populateClsiCacheVariant === 'enabled'
+  const compileFromClsiCache = populateClsiCache // use same split-test
 
   const pdfDownloadDomain = Settings.pdfDownloadDomain
 

+ 1 - 2
services/web/app/src/Features/Project/ProjectController.js

@@ -338,8 +338,7 @@ const _ProjectController = {
       'external-socket-heartbeat',
       'full-project-search',
       'null-test-share-modal',
-      'fall-back-to-clsi-cache',
-      'initial-compile-from-clsi-cache',
+      'populate-clsi-cache',
       'pdf-caching-cached-url-lookup',
       'pdf-caching-mode',
       'pdf-caching-prefetch-large',

+ 1 - 1
services/web/frontend/js/features/pdf-preview/util/pdf-caching-flags.js

@@ -30,4 +30,4 @@ export const projectOwnerHasPremiumOnPageLoad = getMeta(
   'ol-projectOwnerHasPremiumOnPageLoad'
 )
 export const fallBackToClsiCache =
-  projectOwnerHasPremiumOnPageLoad && isFlagEnabled('fall-back-to-clsi-cache')
+  projectOwnerHasPremiumOnPageLoad && isFlagEnabled('populate-clsi-cache')

+ 1 - 1
services/web/frontend/js/shared/context/local-compile-context.tsx

@@ -204,7 +204,7 @@ export const LocalCompileProvider: FC<React.PropsWithChildren> = ({
   // fetch initial compile response from cache
   const [initialCompileFromCache, setInitialCompileFromCache] = useState(
     getMeta('ol-projectOwnerHasPremiumOnPageLoad') &&
-      isSplitTestEnabled('initial-compile-from-clsi-cache') &&
+      isSplitTestEnabled('populate-clsi-cache') &&
       // Avoid fetching the initial compile from cache in PDF detach tab
       role !== 'detached'
   )

+ 1 - 1
services/web/test/frontend/components/pdf-preview/pdf-preview.spec.tsx

@@ -47,7 +47,7 @@ describe('<PdfPreview/>', function () {
       'https://compiles-user.dev-overleaf.com'
     )
     window.metaAttributesCache.set('ol-splitTestVariants', {
-      'initial-compile-from-clsi-cache': 'enabled',
+      'populate-clsi-cache': 'enabled',
     })
     window.metaAttributesCache.set('ol-projectOwnerHasPremiumOnPageLoad', true)
     cy.interceptEvents()