Merge pull request #5975 from overleaf/tm-history-upgrade-count-fails

Fix for counting upgrade failures in history counts script

GitOrigin-RevId: a679fc6e588fc236c31f32e3c27883f25b7f6249
This commit is contained in:
Thomas 2021-12-03 11:00:27 +01:00 committed by Copybot
parent 3ee1e22b0d
commit be17e022a6

View file

@ -38,21 +38,9 @@ async function processBatch(_, projects) {
}
async function processProject(project) {
if (
project.overleaf &&
project.overleaf.history &&
project.overleaf.history.upgradeFailed
) {
// a failed history upgrade might look like a v1 project, but history may be broken
COUNT.HistoryUpgradeFailed += 1
return
}
if (
project.overleaf &&
project.overleaf.history &&
project.overleaf.history.id
) {
if (project.overleaf && project.overleaf.history) {
if (project.overleaf.history.upgradeFailed) {
// a failed history upgrade might look like a v1 project, but history may be broken
COUNT.HistoryUpgradeFailed += 1
if (VERBOSE_LOGGING) {
console.log(
@ -61,16 +49,25 @@ async function processProject(project) {
} has a history upgrade failure recorded`
)
}
return
} else if (project.overleaf.history.conversionFailed) {
COUNT.HistoryConversionFailed += 1
if (VERBOSE_LOGGING) {
console.log(
`project ${
project[VERBOSE_PROJECT_NAMES ? 'name' : '_id']
} has a history upgrade failure recorded`
} has a history conversion failure recorded`
)
}
} else if (project.overleaf.history.display) {
return
}
}
if (
project.overleaf &&
project.overleaf.history &&
project.overleaf.history.id
) {
if (project.overleaf.history.display) {
// v2: full project history, do nothing, (query shoudln't include any, but we should stlll check?)
COUNT.v2 += 1
if (VERBOSE_LOGGING) {