Merge pull request #28346 from overleaf/as-compile-timeout-teardown

[web] Teardown 10s-timeout-enforcement split test

GitOrigin-RevId: 56b286539446e7dab371fb1c7392692cabb15db9
This commit is contained in:
MoxAmber
2025-09-17 14:57:53 +01:00
committed by Copybot
parent 58db03a4ba
commit 6db579c6ac
8 changed files with 7 additions and 197 deletions
@@ -10,7 +10,6 @@ const ClsiManager = require('./ClsiManager')
const Metrics = require('@overleaf/metrics')
const { RateLimiter } = require('../../infrastructure/RateLimiter')
const UserAnalyticsIdCache = require('../Analytics/UserAnalyticsIdCache')
const SplitTestHandler = require('../SplitTests/SplitTestHandler')
const {
callbackify,
callbackifyMultiResult,
@@ -131,17 +130,6 @@ async function _getProjectCompileLimits(project) {
ownerFeatures.compileGroup = 'alpha'
}
if (ownerFeatures.compileTimeout === 20) {
const overrideCompileTimeout =
await SplitTestHandler.promises.getAssignmentForUser(
project.owner_ref,
'10s-timeout-enforcement'
)
if (overrideCompileTimeout.variant === 'enabled') {
ownerFeatures.compileTimeout = 10
}
}
const analyticsId = await UserAnalyticsIdCache.get(owner._id)
const compileGroup =
@@ -783,17 +783,6 @@ const _ProjectController = {
isOverleafAssistBundleEnabled &&
(await ProjectController._getAddonPrices(req, res))
const reducedTimeout =
await SplitTestHandler.promises.getAssignmentForUser(
project.owner_ref,
'10s-timeout-enforcement'
)
let compileTimeout = ownerFeatures?.compileTimeout
if (compileTimeout === 20 && reducedTimeout.variant === 'enabled') {
compileTimeout = 10
}
let planCode = subscription?.planCode
if (!planCode && !userInNonIndividualSub) {
planCode = 'personal'
@@ -899,7 +888,7 @@ const _ProjectController = {
customerIoEnabled,
addonPrices,
compileSettings: {
compileTimeout,
compileTimeout: ownerFeatures?.compileTimeout,
},
})
timer.done()
@@ -134,7 +134,6 @@
"an_email_has_already_been_sent_to": "",
"an_error_occured_while_restoring_project": "",
"an_error_occurred_when_verifying_the_coupon_code": "",
"and_upgrade_for_compile_time": "",
"annual_discount": "",
"anonymous": "",
"anyone_with_link_can_edit": "",
@@ -865,7 +864,6 @@
"integrations": "",
"integrations_like_github": "",
"interested_in_cheaper_personal_plan": "",
"introducing_shorter_compile_timeout": "",
"invalid_confirmation_code": "",
"invalid_email": "",
"invalid_file_name": "",
@@ -1375,8 +1373,6 @@
"reactivating": "",
"read_lines_from_path": "",
"read_more": "",
"read_more_about_compile_timeout_changes": "",
"read_more_about_fix_prevent_timeout": "",
"read_more_about_free_compile_timeouts_servers": "",
"read_only_dropbox_sync_message": "",
"read_only_token": "",
@@ -1835,7 +1831,6 @@
"this_is_a_new_feature": "",
"this_is_the_file_that_references_pulled_from_your_reference_manager_will_be_added_to": "",
"this_project_already_has_maximum_collaborators": "",
"this_project_compiled_but_soon_might_not": "",
"this_project_contains_a_file_called_output_pdf": "",
"this_project_exceeded_collaborator_limit": "",
"this_project_exceeded_compile_timeout_limit_on_free_plan": "",
@@ -2114,8 +2109,8 @@
"well_be_here_when_youre_ready": "",
"were_making_some_changes_to_project_sharing_this_means_you_will_be_visible": "",
"were_performing_maintenance": "",
"were_reducing_compile_timeout": "",
"weve_redesigned_our_editor_to_make_it_easier_to_use_and_future_ready": "",
"weve_reduced_compile_timeout": "",
"what_did_you_find_most_helpful": "",
"what_do_you_need_help_with": "",
"what_does_this_mean_for_you": "",
@@ -2188,7 +2183,6 @@
"you_have_errors_the_pdf_couldnt_compile": "",
"you_have_x_licenses_and_your_plan_supports_up_to_y": "",
"you_have_x_licenses_on_your_subscription": "",
"you_may_be_able_to_fix_issues_to_speed_up_the_compile": "",
"you_need_to_configure_your_sso_settings": "",
"you_unpaused_your_subscription": "",
"you_will_be_able_to_reassign_subscription": "",
@@ -2224,7 +2218,6 @@
"your_plan_is_limited_to_n_editors": "",
"your_plan_is_limited_to_n_editors_plural": "",
"your_premium_plan_is_paused": "",
"your_project_compiled_but_soon_might_not": "",
"your_project_exceeded_collaborator_limit": "",
"your_project_exceeded_compile_timeout_limit_on_free_plan": "",
"your_project_near_compile_timeout_limit": "",
@@ -95,7 +95,7 @@ export const ShortCompileTimeoutErrorState = () => {
<p>
<em>
<Trans
i18nKey="were_reducing_compile_timeout"
i18nKey="weve_reduced_compile_timeout"
components={[
/* eslint-disable-next-line jsx-a11y/anchor-has-content, react/jsx-key */
<a
@@ -1,122 +0,0 @@
import Notification from '@/shared/components/notification'
import StartFreeTrialButton from '@/shared/components/start-free-trial-button'
import { Trans, useTranslation } from 'react-i18next'
import * as eventTracking from '@/infrastructure/event-tracking'
import { FC } from 'react'
export const CompileTimeoutChangingSoon: FC<{
isProjectOwner?: boolean
handleDismissChangingSoon: () => void
segmentation?: eventTracking.Segmentation
}> = ({ isProjectOwner = false, handleDismissChangingSoon, segmentation }) => {
const { t } = useTranslation()
const sendInfoClickEvent = () => {
eventTracking.sendMB('paywall-info-click', {
'paywall-type': 'compile-time-warning',
...segmentation,
content: 'blog',
})
}
const compileTimeoutChangesBlogLink = (
/* eslint-disable-next-line jsx-a11y/anchor-has-content */
<a
aria-label={t('read_more_about_compile_timeout_changes')}
href="/blog/changes-to-free-compile-timeout"
key="compileTimeoutBlogLink1"
rel="noopener noreferrer"
target="_blank"
onClick={sendInfoClickEvent}
/>
)
const fixingCompileTimeoutsLearnLink = (
/* eslint-disable-next-line jsx-a11y/anchor-has-content */
<a
aria-label={t('read_more_about_fix_prevent_timeout')}
href="/learn/how-to/Fixing_and_preventing_compile_timeouts"
key="compileTimeoutBlogLink2"
target="_blank"
rel="noopener noreferrer"
/>
)
if (isProjectOwner) {
return (
<Notification
action={
<StartFreeTrialButton
segmentation={segmentation}
source="compile-time-warning"
buttonProps={{
variant: 'secondary',
size: 'sm',
}}
>
{t('start_free_trial_without_exclamation')}
</StartFreeTrialButton>
}
ariaLive="polite"
content={
<div>
<p>
<Trans
i18nKey="introducing_shorter_compile_timeout"
components={[compileTimeoutChangesBlogLink]}
/>
</p>
<p className="row-spaced">
<Trans
i18nKey="you_may_be_able_to_fix_issues_to_speed_up_the_compile"
components={[fixingCompileTimeoutsLearnLink]}
/>{' '}
<Trans
i18nKey="and_upgrade_for_compile_time"
components={{ strong: <strong /> }}
/>
</p>
</div>
}
title={t('your_project_compiled_but_soon_might_not')}
type="warning"
isActionBelowContent
isDismissible
onDismiss={handleDismissChangingSoon}
/>
)
}
return (
<Notification
ariaLive="polite"
content={
<div>
<p>
<Trans
i18nKey="introducing_shorter_compile_timeout"
components={[compileTimeoutChangesBlogLink]}
/>{' '}
<Trans
i18nKey="you_may_be_able_to_fix_issues_to_speed_up_the_compile"
components={[fixingCompileTimeoutsLearnLink]}
/>
</p>
<p className="row-spaced">
<Trans
i18nKey="tell_the_project_owner_and_ask_them_to_upgrade"
components={[
// eslint-disable-next-line react/jsx-key
<strong />,
]}
/>
</p>
</div>
}
title={t('this_project_compiled_but_soon_might_not')}
type="warning"
isDismissible
onDismiss={handleDismissChangingSoon}
/>
)
}
@@ -4,14 +4,12 @@ import { useDetachCompileContext } from '@/shared/context/detach-compile-context
import usePersistedState from '@/shared/hooks/use-persisted-state'
import { CompileTimeWarningUpgradePromptInner } from '@/features/pdf-preview/components/compile-time-warning-upgrade-prompt-inner'
import getMeta from '@/utils/meta'
import { CompileTimeoutChangingSoon } from './compile-time-changing-soon'
function CompileTimeWarningUpgradePrompt() {
const { isProjectOwner, deliveryLatencies, compiling, showLogs, error } =
useDetachCompileContext()
const [showWarning, setShowWarning] = useState(false)
const [showChangingSoon, setShowChangingSoon] = useState(false)
const [dismissedUntilWarning, setDismissedUntilWarning] = usePersistedState<
Date | undefined
>(`has-dismissed-10s-compile-time-warning-until`)
@@ -25,22 +23,10 @@ function CompileTimeWarningUpgradePrompt() {
[isProjectOwner]
)
const changingSoonSegmentation = useMemo(
() => ({
content: 'changes',
compileTime: 10,
isProjectOwner,
}),
[isProjectOwner]
)
const handleNewCompile = useCallback(
(compileTime: number) => {
setShowWarning(false)
setShowChangingSoon(false)
if (compileTime > 10000) {
setShowChangingSoon(true)
} else if (compileTime > 7000) {
if (compileTime > 7000) {
if (isProjectOwner) {
if (
!dismissedUntilWarning ||
@@ -75,16 +61,6 @@ function CompileTimeWarningUpgradePrompt() {
setDismissedUntilWarning(until)
}, [isProjectOwner, setDismissedUntilWarning])
const handleDismissChangingSoon = useCallback(() => {
eventTracking.sendMB('paywall-dismiss', {
'paywall-type': 'compile-time-warning',
compileTime: 10,
content: 'changes',
isProjectOwner,
})
setShowChangingSoon(false)
}, [isProjectOwner])
useEffect(() => {
if (compiling || error || showLogs) return
handleNewCompile(deliveryLatencies.compileTimeServerE2E)
@@ -103,7 +79,7 @@ function CompileTimeWarningUpgradePrompt() {
return null
}
if (!showWarning && !showChangingSoon) {
if (!showWarning) {
return null
}
@@ -115,13 +91,6 @@ function CompileTimeWarningUpgradePrompt() {
segmentation={warningSegmentation}
/>
)}
{showChangingSoon && (
<CompileTimeoutChangingSoon
isProjectOwner={isProjectOwner}
handleDismissChangingSoon={handleDismissChangingSoon}
segmentation={changingSoonSegmentation}
/>
)}
</div>
)
}
@@ -188,7 +188,7 @@ const PreventTimeoutHelpMessage = memo(function PreventTimeoutHelpMessage({
<p>
<em>
<Trans
i18nKey="were_reducing_compile_timeout"
i18nKey="weve_reduced_compile_timeout"
components={[compileTimeoutChangesBlogLink]}
/>
</em>
+1 -8
View File
@@ -167,7 +167,6 @@
"an_error_occured_while_restoring_project": "An error occured while restoring the project",
"an_error_occurred_when_verifying_the_coupon_code": "An error occurred when verifying the coupon code",
"and": "and",
"and_upgrade_for_compile_time": "And you can <strong>upgrade to get more compile time</strong>.",
"annual": "Annual",
"annual_discount": "Annual discount",
"anonymous": "Anonymous",
@@ -1103,7 +1102,6 @@
"integrations": "Integrations",
"integrations_like_github": "Integrations like GitHub Sync",
"interested_in_cheaper_personal_plan": "Would you be interested in the cheaper <0>__price__</0> Personal plan?",
"introducing_shorter_compile_timeout": "Were <0>introducing a shorter compile timeout limit</0>. This project currently exceeds the new limit, so it might not compile from 25th August 2025.",
"invalid_certificate": "Invalid certificate. Please check the certificate and try again.",
"invalid_confirmation_code": "That didnt work. Please check the code and try again.",
"invalid_email": "An email address is invalid",
@@ -1787,8 +1785,6 @@
"reactivating": "Reactivating",
"read_lines_from_path": "Read lines from __path__",
"read_more": "Read more",
"read_more_about_compile_timeout_changes": "Read more about changes to compile timeout limits",
"read_more_about_fix_prevent_timeout": "Read more about how to fix and prevent timeouts",
"read_more_about_free_compile_timeouts_servers": "Read more about changes to free compile timeouts and servers",
"read_only_dropbox_sync_message": "As a read-only viewer you can sync the current project version to Dropbox, but changes made in Dropbox will <0>not</0> sync back to Overleaf.",
"read_only_token": "Read-Only Token",
@@ -2361,7 +2357,6 @@
"this_is_the_file_that_references_pulled_from_your_reference_manager_will_be_added_to": "This is the file that references pulled from your reference manager will be added to.",
"this_is_your_template": "This is your template from your project",
"this_project_already_has_maximum_collaborators": "This project already has the maximum number of collaborators permitted on the owners plan. This means you can view but not edit or review the project.",
"this_project_compiled_but_soon_might_not": "This project compiled, but soon it might not",
"this_project_contains_a_file_called_output_pdf": "The project contains a file called output.pdf. If that file exists, rename it.",
"this_project_exceeded_collaborator_limit": "This project exceeded the collaborator limit for your plan. All other users now have view-only access.",
"this_project_exceeded_compile_timeout_limit_on_free_plan": "This project exceeded the compile timeout limit on our free plan.",
@@ -2664,8 +2659,8 @@
"well_be_here_when_youre_ready": "Well be here when youre ready to dive back in! 🦆",
"were_making_some_changes_to_project_sharing_this_means_you_will_be_visible": "Were making some <0>changes to project sharing</0>. This means, as someone with edit access, your name and email address will be visible to the project owner and other editors.",
"were_performing_maintenance": "Were performing maintenance on Overleaf and you need to wait a moment. Sorry for any inconvenience. The editor will refresh automatically in __seconds__ seconds.",
"were_reducing_compile_timeout": "Were in the process of <0>reducing the compile timeout limit</0> on our free plan, which may affect your project in future.",
"weve_redesigned_our_editor_to_make_it_easier_to_use_and_future_ready": "Weve redesigned our editor to make it easier to use and future ready. Its now in beta, so try it out and give us your feedback.",
"weve_reduced_compile_timeout": "Weve recently <0>reduced the compile timeout limit</0> on our free plan, which may have affected your project.",
"what_did_you_find_most_helpful": "What did you find most helpful?",
"what_do_you_need": "What do you need?",
"what_do_you_need_help_with": "What do you need help with?",
@@ -2749,7 +2744,6 @@
"you_have_errors_the_pdf_couldnt_compile": "You have errors. The PDF couldnt compile.",
"you_have_x_licenses_and_your_plan_supports_up_to_y": "You have allocated __addedUsersSize__ licenses and your plan supports up to __groupSize__.",
"you_have_x_licenses_on_your_subscription": "You have __groupSize__ licenses on your subscription.",
"you_may_be_able_to_fix_issues_to_speed_up_the_compile": "You may be able to fix issues to <0>speed up the compile</0>.",
"you_need_to_configure_your_sso_settings": "You need to configure and test your SSO settings before enabling SSO",
"you_unpaused_your_subscription": "You unpaused your subscription.",
"you_will_be_able_to_contact_us_any_time_to_share_your_feedback": "<0>You will be able to contact us</0> any time to share your feedback",
@@ -2788,7 +2782,6 @@
"your_plan_is_limited_to_n_editors": "Your plan allows __count__ collaborator with edit access and unlimited viewers.",
"your_plan_is_limited_to_n_editors_plural": "Your plan allows __count__ collaborators with edit access and unlimited viewers.",
"your_premium_plan_is_paused": "Your Premium plan is <0>paused</0>.",
"your_project_compiled_but_soon_might_not": "Your project compiled, but soon it might not",
"your_project_exceeded_collaborator_limit": "Your project exceeded the collaborator limit and access levels were changed. Select a new access level for your collaborators, or upgrade to add more editors or reviewers.",
"your_project_exceeded_compile_timeout_limit_on_free_plan": "Your project exceeded the compile timeout limit on our free plan.",
"your_project_near_compile_timeout_limit": "Your project is near the compile timeout limit for our free plan.",