Skip to content

armgit / ente

Public Imported from GitHub
0

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

allSettled swallows errors

Manav Rathi3d1c1067592b
diff --git a/web/apps/photos/src/services/sync.ts b/web/apps/photos/src/services/sync.ts
index ac16fa54bf..af11377762 100644
--- a/web/apps/photos/src/services/sync.ts
+++ b/web/apps/photos/src/services/sync.ts
@@ -35,7 +35,7 @@ export const triggerPreFileInfoSync = () => {
* before doing the file sync and thus should run immediately after login.
*/
export const sync = async () => {
- await Promise.allSettled([syncMapEnabled()]);
+ await Promise.all([syncMapEnabled()]);
triggerSearchDataSync();
if (isMLSupported) triggerMLSync();
};
diff --git a/web/packages/base/blob-cache.ts b/web/packages/base/blob-cache.ts
index dae10f7725..49a1fb91e7 100644
--- a/web/packages/base/blob-cache.ts
+++ b/web/packages/base/blob-cache.ts
@@ -237,9 +237,8 @@ export const clearBlobCaches = async () => {
return isElectron() ? clearOPFSCaches() : clearWebCaches();
};
-const clearWebCaches = async () => {
- await Promise.allSettled(blobCacheNames.map((name) => caches.delete(name)));
-};
+const clearWebCaches = () =>
+ Promise.all(blobCacheNames.map((name) => caches.delete(name)));
const clearOPFSCaches = async () => {
const root = await navigator.storage.getDirectory();
diff --git a/web/packages/new/photos/services/migrations.ts b/web/packages/new/photos/services/migrations.ts
index c4b0df2183..0c4e18d9cf 100644
--- a/web/packages/new/photos/services/migrations.ts
+++ b/web/packages/new/photos/services/migrations.ts
@@ -43,7 +43,7 @@ export const runMigrations = async () => {
// Added: Aug 2024 (v1.7.3). Prunable.
const m0 = () =>
- Promise.allSettled([
+ Promise.all([
// Delete the legacy face DB v1.
deleteDB("mldata"),
@@ -71,7 +71,7 @@ const m1 = () =>
// Older versions of the user-entities code kept the diff related state
// in a different place. These entries are not needed anymore (the tags
// themselves will get resynced).
- Promise.allSettled([
+ Promise.all([
localForage.removeItem("location_tags"),
localForage.removeItem("location_tags_key"),
localForage.removeItem("location_tags_time"),
diff --git a/web/packages/new/photos/services/search/worker.ts b/web/packages/new/photos/services/search/worker.ts
index 6815b7249d..8d29f2bb70 100644
--- a/web/packages/new/photos/services/search/worker.ts
+++ b/web/packages/new/photos/services/search/worker.ts
@@ -50,7 +50,7 @@ export class SearchWorker {
* Fetch any state we might need when the actual search happens.
*/
async sync() {
- return Promise.allSettled([
+ return Promise.all([
syncLocationTags()
.then(() => savedLocationTags())
.then((ts) => {