From 20c7f14b3cf50075408d076d6a5b7e9664d6371e Mon Sep 17 00:00:00 2001 From: Eric Mc Sween <5454374+emcsween@users.noreply.github.com> Date: Tue, 25 Mar 2025 10:47:44 -0400 Subject: [PATCH] Merge pull request #24461 from overleaf/em-non-editable-file-in-history Graceful fallback for getRangesSnapshot() GitOrigin-RevId: 2f0e70dbcdd38de87d0b1c7590f7d8a5a7112937 --- services/project-history/app/js/SnapshotManager.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/services/project-history/app/js/SnapshotManager.js b/services/project-history/app/js/SnapshotManager.js index f699e834cc..e735fd334b 100644 --- a/services/project-history/app/js/SnapshotManager.js +++ b/services/project-history/app/js/SnapshotManager.js @@ -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))