From a157273b42f8d5a65abc5877de2f2182b340ef09 Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Wed, 26 Feb 2025 12:54:31 +0530 Subject: [PATCH] Remove spurious error on saving edited file in desktop --- web/apps/photos/src/services/upload/uploadManager.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/web/apps/photos/src/services/upload/uploadManager.ts b/web/apps/photos/src/services/upload/uploadManager.ts index 46e72fa316..42f05604f8 100644 --- a/web/apps/photos/src/services/upload/uploadManager.ts +++ b/web/apps/photos/src/services/upload/uploadManager.ts @@ -844,8 +844,15 @@ const markUploaded = async (electron: Electron, item: ClusteredUploadItem) => { } else if (p && typeof p == "object" && "path" in p) { electron.markUploadedFiles([p.path]); } else { - throw new Error( - "Attempting to mark upload completion of unexpected desktop upload items", + // We can come here when the user saves an image they've edited, in + // which case `item` will be a web File object which won't have a + // path. Such a la carte uploads don't mark the file as pending + // anyways, so there isn't anything to do also. + // + // Keeping a log here, though really the upper layers of the code + // need to be reworked so that we don't even get here in such cases. + log.info( + "Ignoring attempt to mark upload completion of (likely edited) item", ); } }