mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 14:13:43 +01:00
Merge pull request #12121 from overleaf/bg-fix-bad-offsets-in-history-migration
fix out of range offsets to avoid invalid history exports GitOrigin-RevId: d00e3e9e08feb6c3be671b5805102a66782b3f92
This commit is contained in:
@@ -107,6 +107,15 @@ async function upgradeProject(project, options) {
|
||||
if (!upgradeFn) {
|
||||
return { error: 'unsupported history type' }
|
||||
}
|
||||
if (options.forceClean) {
|
||||
try {
|
||||
const projectId = project._id
|
||||
// delete any existing history stored in the mongo backend
|
||||
await HistoryManager.promises.deleteProject(projectId, projectId)
|
||||
} catch (err) {
|
||||
// failed to delete existing history, but we can try to continue
|
||||
}
|
||||
}
|
||||
const result = await upgradeFn(project, options)
|
||||
result.historyType = historyType
|
||||
return result
|
||||
|
||||
Reference in New Issue
Block a user