diff --git a/services/web/app/src/Features/Compile/CompileManager.js b/services/web/app/src/Features/Compile/CompileManager.js index 1d63308911..7d9f03a022 100644 --- a/services/web/app/src/Features/Compile/CompileManager.js +++ b/services/web/app/src/Features/Compile/CompileManager.js @@ -220,9 +220,23 @@ module.exports = CompileManager = { if (assignment?.variant === '20s') { if (owner.signUpDate > timeoutEnforcedCutoff) { limits.timeout = 20 + callback(null, limits) + } else { + SplitTestHandler.getAssignmentForMongoUser( + owner, + 'compile-timeout-20s-existing-users', + (err, assignmentExistingUsers) => { + if (err) return callback(err) + if (assignmentExistingUsers?.variant === '20s') { + limits.timeout = 20 + } + callback(null, limits) + } + ) } + } else { + callback(null, limits) } - callback(null, limits) } ) } else { diff --git a/services/web/app/src/Features/Editor/EditorHttpController.js b/services/web/app/src/Features/Editor/EditorHttpController.js index 3958e86e21..719a71b192 100644 --- a/services/web/app/src/Features/Editor/EditorHttpController.js +++ b/services/web/app/src/Features/Editor/EditorHttpController.js @@ -109,8 +109,18 @@ async function joinProject(req, res, next) { // New users will see a 10s warning and compile fail at 20s project.showNewCompileTimeoutUI = 'active' } else { - // Older users aren't limited to 20s, but will see a notice of upcoming changes if compile >20s - project.showNewCompileTimeoutUI = 'changing' + const existingUserTimeoutAssignment = + await SplitTestHandler.promises.getAssignmentForUser( + project.owner._id, + 'compile-timeout-20s-existing-users' + ) + if (existingUserTimeoutAssignment?.variant === '20s') { + // Older users in treatment see 10s warning and compile fail at 20s + project.showNewCompileTimeoutUI = 'active' + } else { + // Older users in control aren't limited to 20s, but will see a notice of upcoming changes if compile >20s + project.showNewCompileTimeoutUI = 'changing' + } } } } diff --git a/services/web/frontend/extracted-translations.json b/services/web/frontend/extracted-translations.json index 640bafb455..44316b2797 100644 --- a/services/web/frontend/extracted-translations.json +++ b/services/web/frontend/extracted-translations.json @@ -102,7 +102,6 @@ "browser": "", "bulk_accept_confirm": "", "bulk_reject_confirm": "", - "but_note_that_free_compile_timeout_limit_will_be_reduced_on_x_date": "", "by_subscribing_you_agree_to_our_terms_of_service": "", "can_edit": "", "can_link_institution_email_acct_to_institution_acct": "", @@ -168,7 +167,7 @@ "comment": "", "commit": "", "common": "", - "common_causes_of_compile_timeouts_are": "", + "common_causes_of_compile_timeouts_include": "", "commons_plan_tooltip": "", "compact": "", "company_name": "", @@ -179,8 +178,8 @@ "compile_larger_projects": "", "compile_mode": "", "compile_terminated_by_user": "", - "compile_timeout_will_be_reduced_project_exceeds_limit_speed_up_compile": "", "compiler": "", + "compiles_on_our_free_plan_are_now_on_faster_servers": "", "compiling": "", "configure_sso": "", "confirm": "", @@ -779,7 +778,6 @@ "organize_projects": "", "other_logs_and_files": "", "other_output_files": "", - "other_ways_to_prevent_compile_timeouts": "", "output_file": "", "overall_theme": "", "overleaf": "", @@ -895,6 +893,7 @@ "ready_to_join_x": "", "ready_to_join_x_in_group_y": "", "realtime_track_changes": "", + "reasons_for_compile_timeouts": "", "reauthorize_github_account": "", "recaptcha_conditions": "", "recent_commits_in_github": "", @@ -1341,6 +1340,10 @@ "we_sent_new_code": "", "wed_love_you_to_stay": "", "welcome_to_sl": "", + "were_in_the_process_of_reducing_compile_timeout_which_may_affect_this_project": "", + "were_in_the_process_of_reducing_compile_timeout_which_may_affect_your_project": "", + "weve_recently_reduced_the_compile_timeout_limit_which_may_have_affected_this_project": "", + "weve_recently_reduced_the_compile_timeout_limit_which_may_have_affected_your_project": "", "what_does_this_mean": "", "what_does_this_mean_for_you": "", "what_happens_when_sso_is_enabled": "", @@ -1376,7 +1379,7 @@ "you_have_been_invited_to_transfer_management_of_your_account": "", "you_have_been_invited_to_transfer_management_of_your_account_to": "", "you_have_been_removed_from_this_project_and_will_be_redirected_to_project_dashboard": "", - "you_may_be_able_to_prevent_a_compile_timeout": "", + "you_may_be_able_to_fix_issues_to_speed_up_the_compile": "", "you_need_to_configure_your_sso_settings": "", "you_will_be_able_to_reassign_subscription": "", "youll_get_best_results_in_visual_but_can_be_used_in_source": "", diff --git a/services/web/frontend/js/features/pdf-preview/components/compile-timeout-changing-soon.tsx b/services/web/frontend/js/features/pdf-preview/components/compile-timeout-changing-soon.tsx index 2f9f487b27..5f6cd56498 100644 --- a/services/web/frontend/js/features/pdf-preview/components/compile-timeout-changing-soon.tsx +++ b/services/web/frontend/js/features/pdf-preview/components/compile-timeout-changing-soon.tsx @@ -17,7 +17,7 @@ export const CompileTimeoutChangingSoon: FC<{ }> = ({ isProjectOwner = false, handleDismissChangingSoon }) => { const { t } = useTranslation() - const compileTimeoutBlogLinks = [ + const compileTimeoutChangesBlogLink = ( /* eslint-disable-next-line jsx-a11y/anchor-has-content */ , + /> + ) + + const fixingCompileTimeoutsLearnLink = ( /* eslint-disable-next-line jsx-a11y/anchor-has-content */ , - ] + /> + ) if (isProjectOwner) { return ( @@ -56,11 +59,14 @@ export const CompileTimeoutChangingSoon: FC<{

+

+

+ {' '}

{' '} +

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 ef3d8ef043..a6d15d42f5 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 @@ -42,6 +42,7 @@ function TimeoutUpgradePromptNew() { compileTimeChanging={compileTimeChanging} handleEnableStopOnFirstErrorClick={handleEnableStopOnFirstErrorClick} lastCompileOptions={lastCompileOptions} + isProjectOwner={isProjectOwner} /> ) @@ -123,12 +124,14 @@ type PreventTimeoutHelpMessageProps = { compileTimeChanging?: boolean lastCompileOptions: any handleEnableStopOnFirstErrorClick: () => void + isProjectOwner: boolean } const PreventTimeoutHelpMessage = memo(function PreventTimeoutHelpMessage({ compileTimeChanging, lastCompileOptions, handleEnableStopOnFirstErrorClick, + isProjectOwner, }: PreventTimeoutHelpMessageProps) { const { t } = useTranslation() @@ -139,38 +142,56 @@ const PreventTimeoutHelpMessage = memo(function PreventTimeoutHelpMessage({ }) } + const compileTimeoutChangesBlogLink = ( + /* eslint-disable-next-line jsx-a11y/anchor-has-content, react/jsx-key */ + + ) + return (

- {t('you_may_be_able_to_prevent_a_compile_timeout')} - {compileTimeChanging && ( - <> - {' '} - , - ]} - values={{ date: 'October 27 2023' }} - shouldUnescape - tOptions={{ interpolation: { escapeValue: true } }} - /> - - )} + + {compileTimeChanging ? ( + <> + {isProjectOwner ? ( + + ) : ( + + )} + + ) : ( + <> + {isProjectOwner ? ( + + ) : ( + + )} + + )} +

-

{t('common_causes_of_compile_timeouts_are')}:

+

{t('common_causes_of_compile_timeouts_include')}: