Merge pull request #23820 from overleaf/jdt-transition-wf-accounts-script

Script to transition WF users from auto-load to auto-create

GitOrigin-RevId: 538ff04dece52e4c46a4a592cb5089d20eb5aa7a
This commit is contained in:
Jimmy Domagala-Tang
2025-02-28 09:05:25 +00:00
committed by Copybot
parent 18c2b4108d
commit 8a81b0777a
5 changed files with 107 additions and 13 deletions
@@ -0,0 +1,28 @@
import { db } from '../../app/src/infrastructure/mongodb.js'
import { batchedUpdate } from '@overleaf/mongo-utils/batchedUpdate.js'
async function main() {
// update all applicable user models
await batchedUpdate(
db.users,
{
'writefull.enabled': false,
},
{
$set: {
'aiErrorAssistant.enabled': false,
},
}
)
console.log('completed syncing writefull state with error assist')
}
export default main
try {
await main()
process.exit(0)
} catch (error) {
console.error({ error })
process.exit(1)
}