Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Fix stuck public album thumbnails after fetch failure

Anand Baburajan3f79b3fcf1d5
diff --git a/web/packages/gallery/services/download.ts b/web/packages/gallery/services/download.ts
index a4fb2e1b02..4d18635867 100644
--- a/web/packages/gallery/services/download.ts
+++ b/web/packages/gallery/services/download.ts
@@ -256,7 +256,15 @@ class DownloadManager {
this.thumbnailURLPromises.set(file.id, url);
}
- let thumb = await this.thumbnailURLPromises.get(file.id);
+ let thumb: string | undefined;
+ try {
+ thumb = await this.thumbnailURLPromises.get(file.id);
+ } catch (e) {
+ // Do not cache a failed promise; allow follow-up calls to retry.
+ this.thumbnailURLPromises.delete(file.id);
+ throw e;
+ }
+
if (cachedOnly) return thumb;
if (!thumb) {