Merge pull request #22882 from overleaf/jpa-file-tree-script

[web] scripts/find_malformed_filetrees: flag missing file hash and folder arrays

GitOrigin-RevId: 8561a59856486bd6903f84a99434d0bd81acb175
This commit is contained in:
Jakob Ackermann
2025-01-20 09:04:45 +00:00
committed by Copybot
parent 58c9f6e76e
commit f03d346a32
2 changed files with 52 additions and 46 deletions
@@ -29,6 +29,11 @@ async function main() {
)
} else if (isName(mongoPath)) {
modifiedCount = await fixName(projectId, mongoPath)
} else if (isHash(mongoPath)) {
console.error(`Missing file hash: ${mongoPath}`)
console.error('SaaS: likely needs filestore restore')
console.error('Server Pro: please reach out to support')
process.exit(1)
} else {
console.error(`Unexpected mongo path: ${mongoPath}`)
process.exit(1)
@@ -72,6 +77,10 @@ function isName(path) {
return /\.name$/.test(path)
}
function isHash(path) {
return /\.hash$/.test(path)
}
function parentPath(path) {
return path.slice(0, path.lastIndexOf('.'))
}