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-18 08:06:14 +00:00
committed by Copybot
parent 176b1a562f
commit e2a704ea93
8 changed files with 7 additions and 197 deletions
@@ -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>