Merge pull request #30393 from overleaf/dp-test-revert-2

Revert "Merge pull request #29916 from overleaf/dp-cleanup-editor-red…

GitOrigin-RevId: c2f14fb55e74a1fcb026e37822774724c36bc0dc
This commit is contained in:
David
2025-12-17 09:07:15 +00:00
committed by Copybot
parent 9aa7a36721
commit bf384683f0
13 changed files with 396 additions and 38 deletions
@@ -22,6 +22,7 @@ import { expressify } from '@overleaf/promise-utils'
import { acceptsJson } from '../../infrastructure/RequestContentTypeDetection.mjs'
import Modules from '../../infrastructure/Modules.mjs'
import OneTimeTokenHandler from '../Security/OneTimeTokenHandler.mjs'
import SplitTestHandler from '../SplitTests/SplitTestHandler.mjs'
async function _sendSecurityAlertClearedSessions(user) {
const emailOptions = {
@@ -411,7 +412,18 @@ async function updateUserSettings(req, res, next) {
user.ace.referencesSearchMode = mode
}
if (body.enableNewEditor != null) {
user.ace.enableNewEditorStageFour = Boolean(body.enableNewEditor)
const assignment = await SplitTestHandler.promises.getAssignment(
req,
res,
'editor-redesign-opt-out'
)
const isOptOutStageEnabled = assignment.variant === 'enabled'
if (isOptOutStageEnabled) {
user.ace.enableNewEditorStageFour = Boolean(body.enableNewEditor)
} else {
user.ace.enableNewEditor = Boolean(body.enableNewEditor)
}
}
if (body.darkModePdf != null) {
user.ace.darkModePdf = Boolean(body.darkModePdf)