Gradual rollout of new compile timeout to existing users (#15478)

* Rollout compile timeout to existing users

* Update copy for compile timeout messages

GitOrigin-RevId: bada02efb3fc506ae6e35bdb7871a58ef4295cbe
This commit is contained in:
Thomas
2023-10-31 09:04:11 +00:00
committed by Copybot
parent 221d16f4e4
commit 3cd0cefd30
7 changed files with 137 additions and 54 deletions
@@ -220,9 +220,23 @@ module.exports = CompileManager = {
if (assignment?.variant === '20s') { if (assignment?.variant === '20s') {
if (owner.signUpDate > timeoutEnforcedCutoff) { if (owner.signUpDate > timeoutEnforcedCutoff) {
limits.timeout = 20 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 { } else {
@@ -109,8 +109,18 @@ async function joinProject(req, res, next) {
// New users will see a 10s warning and compile fail at 20s // New users will see a 10s warning and compile fail at 20s
project.showNewCompileTimeoutUI = 'active' project.showNewCompileTimeoutUI = 'active'
} else { } else {
// Older users aren't limited to 20s, but will see a notice of upcoming changes if compile >20s const existingUserTimeoutAssignment =
project.showNewCompileTimeoutUI = 'changing' 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'
}
} }
} }
} }
@@ -102,7 +102,6 @@
"browser": "", "browser": "",
"bulk_accept_confirm": "", "bulk_accept_confirm": "",
"bulk_reject_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": "", "by_subscribing_you_agree_to_our_terms_of_service": "",
"can_edit": "", "can_edit": "",
"can_link_institution_email_acct_to_institution_acct": "", "can_link_institution_email_acct_to_institution_acct": "",
@@ -168,7 +167,7 @@
"comment": "", "comment": "",
"commit": "", "commit": "",
"common": "", "common": "",
"common_causes_of_compile_timeouts_are": "", "common_causes_of_compile_timeouts_include": "",
"commons_plan_tooltip": "", "commons_plan_tooltip": "",
"compact": "", "compact": "",
"company_name": "", "company_name": "",
@@ -179,8 +178,8 @@
"compile_larger_projects": "", "compile_larger_projects": "",
"compile_mode": "", "compile_mode": "",
"compile_terminated_by_user": "", "compile_terminated_by_user": "",
"compile_timeout_will_be_reduced_project_exceeds_limit_speed_up_compile": "",
"compiler": "", "compiler": "",
"compiles_on_our_free_plan_are_now_on_faster_servers": "",
"compiling": "", "compiling": "",
"configure_sso": "", "configure_sso": "",
"confirm": "", "confirm": "",
@@ -779,7 +778,6 @@
"organize_projects": "", "organize_projects": "",
"other_logs_and_files": "", "other_logs_and_files": "",
"other_output_files": "", "other_output_files": "",
"other_ways_to_prevent_compile_timeouts": "",
"output_file": "", "output_file": "",
"overall_theme": "", "overall_theme": "",
"overleaf": "", "overleaf": "",
@@ -895,6 +893,7 @@
"ready_to_join_x": "", "ready_to_join_x": "",
"ready_to_join_x_in_group_y": "", "ready_to_join_x_in_group_y": "",
"realtime_track_changes": "", "realtime_track_changes": "",
"reasons_for_compile_timeouts": "",
"reauthorize_github_account": "", "reauthorize_github_account": "",
"recaptcha_conditions": "", "recaptcha_conditions": "",
"recent_commits_in_github": "", "recent_commits_in_github": "",
@@ -1341,6 +1340,10 @@
"we_sent_new_code": "", "we_sent_new_code": "",
"wed_love_you_to_stay": "", "wed_love_you_to_stay": "",
"welcome_to_sl": "", "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": "",
"what_does_this_mean_for_you": "", "what_does_this_mean_for_you": "",
"what_happens_when_sso_is_enabled": "", "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": "",
"you_have_been_invited_to_transfer_management_of_your_account_to": "", "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_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_need_to_configure_your_sso_settings": "",
"you_will_be_able_to_reassign_subscription": "", "you_will_be_able_to_reassign_subscription": "",
"youll_get_best_results_in_visual_but_can_be_used_in_source": "", "youll_get_best_results_in_visual_but_can_be_used_in_source": "",
@@ -17,7 +17,7 @@ export const CompileTimeoutChangingSoon: FC<{
}> = ({ isProjectOwner = false, handleDismissChangingSoon }) => { }> = ({ isProjectOwner = false, handleDismissChangingSoon }) => {
const { t } = useTranslation() const { t } = useTranslation()
const compileTimeoutBlogLinks = [ const compileTimeoutChangesBlogLink = (
/* eslint-disable-next-line jsx-a11y/anchor-has-content */ /* eslint-disable-next-line jsx-a11y/anchor-has-content */
<a <a
aria-label={t('read_more_about_free_compile_timeouts_servers')} aria-label={t('read_more_about_free_compile_timeouts_servers')}
@@ -26,7 +26,10 @@ export const CompileTimeoutChangingSoon: FC<{
rel="noopener noreferrer" rel="noopener noreferrer"
target="_blank" target="_blank"
onClick={sendInfoClickEvent} onClick={sendInfoClickEvent}
/>, />
)
const fixingCompileTimeoutsLearnLink = (
/* eslint-disable-next-line jsx-a11y/anchor-has-content */ /* eslint-disable-next-line jsx-a11y/anchor-has-content */
<a <a
aria-label={t('read_more_about_fix_prevent_timeout')} aria-label={t('read_more_about_fix_prevent_timeout')}
@@ -34,8 +37,8 @@ export const CompileTimeoutChangingSoon: FC<{
key="compileTimeoutBlogLink2" key="compileTimeoutBlogLink2"
target="_blank" target="_blank"
rel="noopener noreferrer" rel="noopener noreferrer"
/>, />
] )
if (isProjectOwner) { if (isProjectOwner) {
return ( return (
@@ -56,11 +59,14 @@ export const CompileTimeoutChangingSoon: FC<{
<div> <div>
<p> <p>
<Trans <Trans
i18nKey="compile_timeout_will_be_reduced_project_exceeds_limit_speed_up_compile" i18nKey="compiles_on_our_free_plan_are_now_on_faster_servers"
components={compileTimeoutBlogLinks} components={[compileTimeoutChangesBlogLink]}
values={{ date: 'October 27 2023' }} />
shouldUnescape </p>
tOptions={{ interpolation: { escapeValue: true } }} <p className="row-spaced">
<Trans
i18nKey="you_may_be_able_to_fix_issues_to_speed_up_the_compile"
components={[fixingCompileTimeoutsLearnLink]}
/>{' '} />{' '}
<Trans <Trans
i18nKey="and_you_can_upgrade_for_plenty_more_compile_time" i18nKey="and_you_can_upgrade_for_plenty_more_compile_time"
@@ -85,11 +91,12 @@ export const CompileTimeoutChangingSoon: FC<{
<div> <div>
<p> <p>
<Trans <Trans
i18nKey="compile_timeout_will_be_reduced_project_exceeds_limit_speed_up_compile" i18nKey="compiles_on_our_free_plan_are_now_on_faster_servers"
components={compileTimeoutBlogLinks} components={[compileTimeoutChangesBlogLink]}
values={{ date: 'October 27 2023' }} />{' '}
shouldUnescape <Trans
tOptions={{ interpolation: { escapeValue: true } }} i18nKey="you_may_be_able_to_fix_issues_to_speed_up_the_compile"
components={[fixingCompileTimeoutsLearnLink]}
/> />
</p> </p>
<p className="row-spaced"> <p className="row-spaced">
@@ -42,6 +42,7 @@ function TimeoutUpgradePromptNew() {
compileTimeChanging={compileTimeChanging} compileTimeChanging={compileTimeChanging}
handleEnableStopOnFirstErrorClick={handleEnableStopOnFirstErrorClick} handleEnableStopOnFirstErrorClick={handleEnableStopOnFirstErrorClick}
lastCompileOptions={lastCompileOptions} lastCompileOptions={lastCompileOptions}
isProjectOwner={isProjectOwner}
/> />
</> </>
) )
@@ -123,12 +124,14 @@ type PreventTimeoutHelpMessageProps = {
compileTimeChanging?: boolean compileTimeChanging?: boolean
lastCompileOptions: any lastCompileOptions: any
handleEnableStopOnFirstErrorClick: () => void handleEnableStopOnFirstErrorClick: () => void
isProjectOwner: boolean
} }
const PreventTimeoutHelpMessage = memo(function PreventTimeoutHelpMessage({ const PreventTimeoutHelpMessage = memo(function PreventTimeoutHelpMessage({
compileTimeChanging, compileTimeChanging,
lastCompileOptions, lastCompileOptions,
handleEnableStopOnFirstErrorClick, handleEnableStopOnFirstErrorClick,
isProjectOwner,
}: PreventTimeoutHelpMessageProps) { }: PreventTimeoutHelpMessageProps) {
const { t } = useTranslation() 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 */
<a
aria-label={t('read_more_about_free_compile_timeouts_servers')}
href="/blog/changes-to-free-compile-timeouts-and-servers"
rel="noopener noreferrer"
target="_blank"
onClick={sendInfoClickEvent}
/>
)
return ( return (
<PdfLogEntry <PdfLogEntry
headerTitle={t('other_ways_to_prevent_compile_timeouts')} headerTitle={t('reasons_for_compile_timeouts')}
formattedContent={ formattedContent={
<> <>
<p> <p>
{t('you_may_be_able_to_prevent_a_compile_timeout')} <em>
{compileTimeChanging && ( {compileTimeChanging ? (
<> <>
{' '} {isProjectOwner ? (
<Trans <Trans
i18nKey="but_note_that_free_compile_timeout_limit_will_be_reduced_on_x_date" i18nKey="were_in_the_process_of_reducing_compile_timeout_which_may_affect_your_project"
components={[ components={[compileTimeoutChangesBlogLink]}
// eslint-disable-next-line jsx-a11y/anchor-has-content, react/jsx-key />
<a ) : (
aria-label={t( <Trans
'read_more_about_free_compile_timeouts_servers' i18nKey="were_in_the_process_of_reducing_compile_timeout_which_may_affect_this_project"
)} components={[compileTimeoutChangesBlogLink]}
href="/blog/changes-to-free-compile-timeouts-and-servers" />
rel="noopener noreferrer" )}
target="_blank" </>
onClick={sendInfoClickEvent} ) : (
/>, <>
]} {isProjectOwner ? (
values={{ date: 'October 27 2023' }} <Trans
shouldUnescape i18nKey="weve_recently_reduced_the_compile_timeout_limit_which_may_have_affected_your_project"
tOptions={{ interpolation: { escapeValue: true } }} components={[compileTimeoutChangesBlogLink]}
/> />
</> ) : (
)} <Trans
i18nKey="weve_recently_reduced_the_compile_timeout_limit_which_may_have_affected_this_project"
components={[compileTimeoutChangesBlogLink]}
/>
)}
</>
)}
</em>
</p> </p>
<p>{t('common_causes_of_compile_timeouts_are')}:</p> <p>{t('common_causes_of_compile_timeouts_include')}:</p>
<ul> <ul>
<li> <li>
<Trans <Trans
@@ -233,7 +254,7 @@ const PreventTimeoutHelpMessage = memo(function PreventTimeoutHelpMessage({
</> </>
} }
// @ts-ignore // @ts-ignore
entryAriaLabel={t('other_ways_to_prevent_compile_timeouts')} entryAriaLabel={t('reasons_for_compile_timeouts')}
level="raw" level="raw"
/> />
) )
+8 -5
View File
@@ -177,7 +177,6 @@
"built_in": "Built-In", "built_in": "Built-In",
"bulk_accept_confirm": "Are you sure you want to accept the selected __nChanges__ changes?", "bulk_accept_confirm": "Are you sure you want to accept the selected __nChanges__ changes?",
"bulk_reject_confirm": "Are you sure you want to reject the selected __nChanges__ changes?", "bulk_reject_confirm": "Are you sure you want to reject the selected __nChanges__ changes?",
"but_note_that_free_compile_timeout_limit_will_be_reduced_on_x_date": "But note that the free compile timeout limit <0>will be reduced on __date__</0>.",
"buy_now_no_exclamation_mark": "Buy now", "buy_now_no_exclamation_mark": "Buy now",
"by": "by", "by": "by",
"by_registering_you_agree_to_our_terms_of_service": "By registering, you agree to our <0>terms of service</0>.", "by_registering_you_agree_to_our_terms_of_service": "By registering, you agree to our <0>terms of service</0>.",
@@ -269,7 +268,7 @@
"comment": "Comment", "comment": "Comment",
"commit": "Commit", "commit": "Commit",
"common": "Common", "common": "Common",
"common_causes_of_compile_timeouts_are": "Common causes of compile timeouts are", "common_causes_of_compile_timeouts_include": "Common causes of compile timeouts include",
"commons_plan_tooltip": "Youre on the __plan__ plan because of your affiliation with __institution__. Click to find out how to make the most of your Overleaf premium features.", "commons_plan_tooltip": "Youre on the __plan__ plan because of your affiliation with __institution__. Click to find out how to make the most of your Overleaf premium features.",
"compact": "Compact", "compact": "Compact",
"company_name": "Company Name", "company_name": "Company Name",
@@ -287,8 +286,8 @@
"compile_timeout_short": "Compile timeout", "compile_timeout_short": "Compile timeout",
"compile_timeout_short_info": "This is how much time you get to compile your project on the Overleaf servers. For short and simple projects, 1 minute should be enough, but you may need longer for complex or longer projects", "compile_timeout_short_info": "This is how much time you get to compile your project on the Overleaf servers. For short and simple projects, 1 minute should be enough, but you may need longer for complex or longer projects",
"compile_timeout_short_info_basic": "This is how much time you get to compile your project on the Overleaf servers. You may need additional time for longer or more complex projects.", "compile_timeout_short_info_basic": "This is how much time you get to compile your project on the Overleaf servers. You may need additional time for longer or more complex projects.",
"compile_timeout_will_be_reduced_project_exceeds_limit_speed_up_compile": "The compile timeout limit on our free plan <0>will be reduced on __date__</0> and this project currently exceeds the new limit. You may be able to fix issues to <1>speed up the compile</1>.",
"compiler": "Compiler", "compiler": "Compiler",
"compiles_on_our_free_plan_are_now_on_faster_servers": "Compiles on our free plan are now on faster servers, and were gradually <0>introducing a shorter compile timeout limit</0>. This project currently exceeds the new limit, so it might not compile in future.",
"compiling": "Compiling", "compiling": "Compiling",
"complete": "Complete", "complete": "Complete",
"compliance": "Compliance", "compliance": "Compliance",
@@ -1218,7 +1217,6 @@
"other_logs_and_files": "Other logs and files", "other_logs_and_files": "Other logs and files",
"other_output_files": "Download other output files", "other_output_files": "Download other output files",
"other_sessions": "Other Sessions", "other_sessions": "Other Sessions",
"other_ways_to_prevent_compile_timeouts": "Other ways to prevent compile timeouts",
"our_values": "Our values", "our_values": "Our values",
"output_file": "Output file", "output_file": "Output file",
"over": "over", "over": "over",
@@ -1390,6 +1388,7 @@
"realtime_track_changes": "Real-time track changes", "realtime_track_changes": "Real-time track changes",
"realtime_track_changes_info": "Now you dont have to choose between tracked changes and typesetting in LaTeX. Leave comments, keep track of TODOs, and accept or reject others changes.", "realtime_track_changes_info": "Now you dont have to choose between tracked changes and typesetting in LaTeX. Leave comments, keep track of TODOs, and accept or reject others changes.",
"realtime_track_changes_info_v2": "Switch on track changes to see who made every change, accept or reject others changes, and write comments.", "realtime_track_changes_info_v2": "Switch on track changes to see who made every change, accept or reject others changes, and write comments.",
"reasons_for_compile_timeouts": "Reasons for compile timeouts",
"reauthorize_github_account": "Reauthorize your GitHub Account", "reauthorize_github_account": "Reauthorize your GitHub Account",
"recaptcha_conditions": "The site is protected by reCAPTCHA and the Google <1>Privacy Policy</1> and <2>Terms of Service</2> apply.", "recaptcha_conditions": "The site is protected by reCAPTCHA and the Google <1>Privacy Policy</1> and <2>Terms of Service</2> apply.",
"recent": "Recent", "recent": "Recent",
@@ -2003,6 +2002,10 @@
"website_status": "Website status", "website_status": "Website status",
"wed_love_you_to_stay": "Wed love you to stay", "wed_love_you_to_stay": "Wed love you to stay",
"welcome_to_sl": "Welcome to __appName__!", "welcome_to_sl": "Welcome to __appName__!",
"were_in_the_process_of_reducing_compile_timeout_which_may_affect_this_project": "Were in the process of <0>reducing the compile timeout limit</0> on our free plan, which may affect this project in future.",
"were_in_the_process_of_reducing_compile_timeout_which_may_affect_your_project": "Were in the process of <0>reducing the compile timeout limit</0> on our free plan, which may affect your project in future.",
"weve_recently_reduced_the_compile_timeout_limit_which_may_have_affected_this_project": "Weve recently <0>reduced the compile timeout limit</0> on our free plan, which may have affected this project.",
"weve_recently_reduced_the_compile_timeout_limit_which_may_have_affected_your_project": "Weve recently <0>reduced the compile timeout limit</0> on our free plan, which may have affected your project.",
"what_does_this_mean": "What does this mean?", "what_does_this_mean": "What does this mean?",
"what_does_this_mean_for_you": "This means:", "what_does_this_mean_for_you": "This means:",
"what_happens_when_sso_is_enabled": "What happens when SSO is enabled?", "what_happens_when_sso_is_enabled": "What happens when SSO is enabled?",
@@ -2058,7 +2061,7 @@
"you_have_been_removed_from_this_project_and_will_be_redirected_to_project_dashboard": "You have been removed from this project, and will no longer have access to it. You will be redirected to your project dashboard momentarily.", "you_have_been_removed_from_this_project_and_will_be_redirected_to_project_dashboard": "You have been removed from this project, and will no longer have access to it. You will be redirected to your project dashboard momentarily.",
"you_introed_high_number": " Youve introduced <0>__numberOfPeople__</0> people to __appName__. Good job!", "you_introed_high_number": " Youve introduced <0>__numberOfPeople__</0> people to __appName__. Good job!",
"you_introed_small_number": " Youve introduced <0>__numberOfPeople__</0> person to __appName__. Good job, but can you get some more?", "you_introed_small_number": " Youve introduced <0>__numberOfPeople__</0> person to __appName__. Good job, but can you get some more?",
"you_may_be_able_to_prevent_a_compile_timeout": "You may be able to prevent a compile timeout using the following tips.", "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 your SSO settings before enabling SSO", "you_need_to_configure_your_sso_settings": "You need to configure your SSO settings before enabling SSO",
"you_not_introed_anyone_to_sl": "Youve not introduced anyone to __appName__ yet. Get sharing!", "you_not_introed_anyone_to_sl": "Youve not introduced anyone to __appName__ yet. Get sharing!",
"you_plus_1": "You + 1", "you_plus_1": "You + 1",
@@ -298,6 +298,31 @@ describe('CompileManager', function () {
.calledWith(null, sinon.match({ timeout: 60 })) .calledWith(null, sinon.match({ timeout: 60 }))
.should.equal(true) .should.equal(true)
}) })
describe('user is in the compile-timeout-20s-existing-users treatment', function () {
beforeEach(function () {
this.getAssignmentForMongoUser.callsFake((user, test, cb) => {
if (test === 'compile-backend-class-n2d') {
cb(null, { variant: 'n2d' })
}
if (test === 'compile-timeout-20s') {
cb(null, { variant: '20s' })
}
if (test === 'compile-timeout-20s-existing-users') {
cb(null, { variant: '20s' })
}
})
})
it('should reduce compile timeout to 20s', function () {
this.CompileManager.getProjectCompileLimits(
this.project_id,
this.callback
)
this.callback
.calledWith(null, sinon.match({ timeout: 20 }))
.should.equal(true)
})
})
}) })
describe('user registered after the cut off date', function () { describe('user registered after the cut off date', function () {
beforeEach(function () { beforeEach(function () {