diff --git a/services/web/app/src/Features/Authentication/AuthenticationController.mjs b/services/web/app/src/Features/Authentication/AuthenticationController.mjs index 66e005f0d6..89477058bc 100644 --- a/services/web/app/src/Features/Authentication/AuthenticationController.mjs +++ b/services/web/app/src/Features/Authentication/AuthenticationController.mjs @@ -109,7 +109,7 @@ const AuthenticationController = { analyticsId: user.analyticsId || user._id, alphaProgram: user.alphaProgram || undefined, // only store if set betaProgram: user.betaProgram || undefined, // only store if set - labsProgram: user.labsProgram || undefined, // only store if set + labsProgram: user.labsProgram, // always store, we could revert about 1 week after deploying this change. } if (user.isAdmin) { lightUser.isAdmin = true diff --git a/tools/migrations/20260615090000_back_fill_labsProgram.mjs b/tools/migrations/20260615090000_back_fill_labsProgram.mjs new file mode 100644 index 0000000000..ce54e0f579 --- /dev/null +++ b/tools/migrations/20260615090000_back_fill_labsProgram.mjs @@ -0,0 +1,20 @@ +import { batchedUpdate } from '@overleaf/mongo-utils/batchedUpdate.js' + +const tags = ['server-ce', 'server-pro', 'saas', 'nonblocking'] + +const migrate = async client => { + const { db } = client + await batchedUpdate( + db.users, + { labsProgram: { $ne: true } }, + { $set: { labsProgram: false } } + ) +} + +const rollback = async () => {} + +export default { + tags, + migrate, + rollback, +}