Merge pull request #24461 from overleaf/em-non-editable-file-in-history

Graceful fallback for getRangesSnapshot()

GitOrigin-RevId: 2f0e70dbcdd38de87d0b1c7590f7d8a5a7112937
This commit is contained in:
Eric Mc Sween
2025-03-26 09:05:21 +00:00
committed by Copybot
parent b480903426
commit 20c7f14b3c
@@ -73,7 +73,11 @@ async function getRangesSnapshot(projectId, version, pathname) {
})
}
if (!file.isEditable()) {
throw new Error('File is not editable')
// A binary file has no tracked changes or comments
return {
changes: [],
comments: [],
}
}
const historyId = await WebApiManager.promises.getHistoryId(projectId)
await file.load('eager', HistoryStoreManager.getBlobStore(historyId))