π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
add log if user has hidden-albums if file is not found.
Abhinavd1fc3f5454b9
diff --git a/apps/photos/src/services/embeddingService.ts b/apps/photos/src/services/embeddingService.tsindex d29746dd12..d2767e9385 100644--- a/apps/photos/src/services/embeddingService.ts+++ b/apps/photos/src/services/embeddingService.ts@@ -14,6 +14,8 @@ import HTTPService from '@ente/shared/network/HTTPService';import { getToken } from '@ente/shared/storage/localStorage/helpers';import { getLatestVersionEmbeddings } from 'utils/embedding';import { getLocalTrashedFiles } from './trashService';+import { getLocalCollections } from './collectionService';+import { CustomError } from '@ente/shared/error';const ENDPOINT = getEndpoint();@@ -67,7 +69,7 @@ export const syncEmbeddings = async () => {const worker = await ComlinkCryptoWorker.getInstance();const fileKey = fileIdToKeyMap.get(embedding.fileID);if (!fileKey) {- throw Error('File key not found');+ throw Error(CustomError.FILE_NOT_FOUND);}const decryptedData = await worker.decryptEmbedding(encryptedEmbedding,@@ -80,7 +82,17 @@ export const syncEmbeddings = async () => {embedding: decryptedData,} as Embedding;} catch (e) {- logError(e, 'decryptEmbedding failed for file');+ let info: Record<string, unknown>;+ if (e.message === CustomError.FILE_NOT_FOUND) {+ const hiddenAlbums = await getLocalCollections(+ 'hidden'+ );+ const hasHiddenAlbums = hiddenAlbums?.length > 0;+ info = {+ hasHiddenAlbums,+ };+ }+ logError(e, 'decryptEmbedding failed for file', info);}}));diff --git a/packages/shared/error/index.ts b/packages/shared/error/index.tsindex 55c3f9f591..1e037b7ef9 100644--- a/packages/shared/error/index.ts+++ b/packages/shared/error/index.ts@@ -84,6 +84,7 @@ export const CustomError = {TWO_FACTOR_ENABLED: 'two factor enabled',CLIENT_ERROR: 'client error',ServerError: 'server error',+ FILE_NOT_FOUND: 'file not found',};export function handleUploadError(error: any): Error {