diff --git a/services/web/.storybook/preview.tsx b/services/web/.storybook/preview.tsx index 591f38b4ab..fe3aa3d6fb 100644 --- a/services/web/.storybook/preview.tsx +++ b/services/web/.storybook/preview.tsx @@ -16,7 +16,6 @@ function resetMeta() { window.metaAttributesCache.set('ol-projectHistoryBlobsEnabled', true) window.metaAttributesCache.set('ol-capabilities', ['chat']) window.metaAttributesCache.set('ol-compileSettings', { - reducedTimeoutWarning: 'default', compileTimeout: 20, }) window.metaAttributesCache.set('ol-ExposedSettings', { diff --git a/services/web/app/src/Features/Project/ProjectController.js b/services/web/app/src/Features/Project/ProjectController.js index 24c28255f8..2c8d839a33 100644 --- a/services/web/app/src/Features/Project/ProjectController.js +++ b/services/web/app/src/Features/Project/ProjectController.js @@ -736,12 +736,6 @@ const _ProjectController = { isOverleafAssistBundleEnabled && (await ProjectController._getAddonPrices(req, res)) - const reducedTimeoutWarning = - await SplitTestHandler.promises.getAssignmentForUser( - project.owner_ref, - '10s-timeout-warning' - ) - let planCode = subscription?.planCode if (!planCode && !userInNonIndividualSub) { planCode = 'personal' @@ -849,7 +843,6 @@ const _ProjectController = { customerIoEnabled, addonPrices, compileSettings: { - reducedTimeoutWarning: reducedTimeoutWarning?.variant, compileTimeout: ownerFeatures?.compileTimeout, }, }) diff --git a/services/web/frontend/js/features/pdf-preview/components/compile-time-warning-upgrade-prompt.tsx b/services/web/frontend/js/features/pdf-preview/components/compile-time-warning-upgrade-prompt.tsx index 164c3c3275..52c4ec0718 100644 --- a/services/web/frontend/js/features/pdf-preview/components/compile-time-warning-upgrade-prompt.tsx +++ b/services/web/frontend/js/features/pdf-preview/components/compile-time-warning-upgrade-prompt.tsx @@ -15,42 +15,32 @@ function CompileTimeWarningUpgradePrompt() { const [dismissedUntilWarning, setDismissedUntilWarning] = usePersistedState< Date | undefined >(`has-dismissed-10s-compile-time-warning-until`) - const { reducedTimeoutWarning } = getMeta('ol-compileSettings') - const warningThreshold = reducedTimeoutWarning === 'enabled' ? 7 : 10 - - const sharedSegmentation = useMemo( - () => ({ - '10s-timeout-warning': reducedTimeoutWarning, - 'is-owner': isProjectOwner, - }), - [isProjectOwner, reducedTimeoutWarning] - ) const warningSegmentation = useMemo( () => ({ content: 'warning', - compileTime: warningThreshold, - ...sharedSegmentation, + compileTime: 7, + isProjectOwner, }), - [sharedSegmentation, warningThreshold] + [isProjectOwner] ) const changingSoonSegmentation = useMemo( () => ({ content: 'changes', compileTime: 10, - ...sharedSegmentation, + isProjectOwner, }), - [sharedSegmentation] + [isProjectOwner] ) const handleNewCompile = useCallback( (compileTime: number) => { setShowWarning(false) setShowChangingSoon(false) - if (reducedTimeoutWarning === 'enabled' && compileTime > 10000) { + if (compileTime > 10000) { setShowChangingSoon(true) - } else if (compileTime > warningThreshold * 1000) { + } else if (compileTime > 7000) { if (isProjectOwner) { if ( !dismissedUntilWarning || @@ -58,52 +48,42 @@ function CompileTimeWarningUpgradePrompt() { ) { setShowWarning(true) eventTracking.sendMB('compile-time-warning-displayed', { - compileTime: warningThreshold, + compileTime: 7, isProjectOwner, }) } } } }, - [ - isProjectOwner, - dismissedUntilWarning, - reducedTimeoutWarning, - warningThreshold, - ] + [isProjectOwner, dismissedUntilWarning] ) const handleDismissWarning = useCallback(() => { eventTracking.sendMB('compile-time-warning-dismissed', { - compileTime: warningThreshold, + compileTime: 7, isProjectOwner, }) eventTracking.sendMB('paywall-dismiss', { 'paywall-type': 'compile-time-warning', content: 'warning', - compileTime: warningThreshold, - ...sharedSegmentation, + compileTime: 7, + isProjectOwner, }) setShowWarning(false) const until = new Date() until.setDate(until.getDate() + 1) // 1 day setDismissedUntilWarning(until) - }, [ - isProjectOwner, - setDismissedUntilWarning, - warningThreshold, - sharedSegmentation, - ]) + }, [isProjectOwner, setDismissedUntilWarning]) const handleDismissChangingSoon = useCallback(() => { eventTracking.sendMB('paywall-dismiss', { 'paywall-type': 'compile-time-warning', compileTime: 10, content: 'changes', - ...sharedSegmentation, + isProjectOwner, }) setShowChangingSoon(false) - }, [sharedSegmentation]) + }, [isProjectOwner]) useEffect(() => { if (compiling || error || showLogs) return diff --git a/services/web/frontend/js/features/pdf-preview/components/timeout-upgrade-prompt-new.tsx b/services/web/frontend/js/features/pdf-preview/components/timeout-upgrade-prompt-new.tsx index c5aa6950b2..bf58d6ad12 100644 --- a/services/web/frontend/js/features/pdf-preview/components/timeout-upgrade-prompt-new.tsx +++ b/services/web/frontend/js/features/pdf-preview/components/timeout-upgrade-prompt-new.tsx @@ -26,16 +26,14 @@ function TimeoutUpgradePromptNew() { setAnimateCompileDropdownArrow(true) }, [enableStopOnFirstError, startCompile, setAnimateCompileDropdownArrow]) - const { reducedTimeoutWarning, compileTimeout } = - getMeta('ol-compileSettings') + const { compileTimeout } = getMeta('ol-compileSettings') const sharedSegmentation = useMemo( () => ({ - '10s-timeout-warning': reducedTimeoutWarning, 'is-owner': isProjectOwner, compileTime: compileTimeout, }), - [isProjectOwner, reducedTimeoutWarning, compileTimeout] + [isProjectOwner, compileTimeout] ) return ( @@ -152,16 +150,14 @@ const PreventTimeoutHelpMessage = memo(function PreventTimeoutHelpMessage({ headerTitle={t('reasons_for_compile_timeouts')} formattedContent={ <> - {segmentation?.['10s-timeout-warning'] === 'enabled' && ( -
-
-
+
+
{t('common_causes_of_compile_timeouts_include')}: