Skip to content

armgit / ente

Public Imported from GitHub
0

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

dedup

Manav Rathif0f3af96d1bc
diff --git a/web/apps/photos/src/services/logout.ts b/web/apps/photos/src/services/logout.ts
index 9b664bf579..33854f5578 100644
--- a/web/apps/photos/src/services/logout.ts
+++ b/web/apps/photos/src/services/logout.ts
@@ -14,18 +14,21 @@ import mlWorkManager from "./machineLearning/mlWorkManager";
* See: [Note: Do not throw during logout].
*/
export const photosLogout = async () => {
+ const ignoreError = (e: unknown, label: string) =>
+ log.error(`Ignoring error during logout (${label})`, e);
+
await accountLogout();
try {
await DownloadManager.logout();
} catch (e) {
- log.error("Ignoring error during logout (download)", e);
+ ignoreError("download", e);
}
try {
await clipService.logout();
} catch (e) {
- log.error("Ignoring error during logout (CLIP)", e);
+ ignoreError("CLIP", e);
}
const electron = globalThis.electron;
@@ -33,25 +36,25 @@ export const photosLogout = async () => {
try {
await mlWorkManager.logout();
} catch (e) {
- log.error("Ignoring error during logout (ML)", e);
+ ignoreError("ML", e);
}
try {
await clearFaceData();
} catch (e) {
- log.error("Ignoring error during logout (face)", e);
+ ignoreError("face", e);
}
try {
exportService.disableContinuousExport();
} catch (e) {
- log.error("Ignoring error during logout (export)", e);
+ ignoreError("export", e);
}
try {
await electron?.logout();
} catch (e) {
- log.error("Ignoring error during logout (electron)", e);
+ ignoreError("electron", e);
}
}
};
diff --git a/web/packages/accounts/services/logout.ts b/web/packages/accounts/services/logout.ts
index 1858ec7cc3..d70b1c36b3 100644
--- a/web/packages/accounts/services/logout.ts
+++ b/web/packages/accounts/services/logout.ts
@@ -17,34 +17,37 @@ import { logout as remoteLogout } from "../api/user";
* gets in an unexpected state.
*/
export const accountLogout = async () => {
+ const ignoreError = (e: unknown, label: string) =>
+ log.error(`Ignoring error during logout (${label})`, e);
+
try {
await remoteLogout();
} catch (e) {
- log.error("Ignoring error during logout (remote)", e);
+ ignoreError("remote", e);
}
try {
InMemoryStore.clear();
} catch (e) {
- log.error("Ignoring error during logout (in-memory store)", e);
+ ignoreError("in-memory store", e);
}
try {
clearKeys();
} catch (e) {
- log.error("Ignoring error during logout (session store)", e);
+ ignoreError("session store", e);
}
try {
clearData();
} catch (e) {
- log.error("Ignoring error during logout (local storage)", e);
+ ignoreError("local storage", e);
}
try {
await localForage.clear();
} catch (e) {
- log.error("Ignoring error during logout (local forage)", e);
+ ignoreError("local forage", e);
}
try {
await clearBlobCaches();
} catch (e) {
- log.error("Ignoring error during logout (cache)", e);
+ ignoreError("cache", e);
}
};