Merge pull request #20129 from overleaf/jpa-handle-partial-deletion

[misc] improve handling of document deletion

GitOrigin-RevId: bd6b225b91ab38365e9ff272c50ece995e767bf2
This commit is contained in:
Jakob Ackermann
2024-08-26 15:09:25 +02:00
committed by Copybot
parent 2dcf87e3f6
commit a98fefd24b
5 changed files with 346 additions and 4 deletions
@@ -774,6 +774,10 @@ const deleteEntity = wrapWithLock(
throw new Error('No entityType set')
}
entityType = entityType.toLowerCase()
// Flush the entire project to avoid leaving partially deleted docs in redis.
await DocumentUpdaterHandler.promises.flushProjectToMongo(projectId)
const { entity, path, projectBeforeDeletion, newProject } =
await ProjectEntityMongoUpdateHandler.promises.deleteEntity(
projectId,