diff --git a/apps/photos/src/services/cache/cacheStorageService.ts b/apps/photos/src/services/cache/cacheStorageService.ts index c9f9138fb..adb9731dd 100644 --- a/apps/photos/src/services/cache/cacheStorageService.ts +++ b/apps/photos/src/services/cache/cacheStorageService.ts @@ -1,20 +1,32 @@ import { logError } from 'utils/sentry'; import { CacheStorageFactory } from './cacheStorageFactory'; +const SecurityError = 'SecurityError'; +const INSECURE_OPERATION = 'The operation is insecure.'; async function openCache(cacheName: string) { try { return await CacheStorageFactory.getCacheStorage().open(cacheName); } catch (e) { - // log and ignore, we don't want to break the caller flow, when cache is not available - logError(e, 'openCache failed'); + // ignoring insecure operation error, as it is thrown in incognito mode in firefox + if (e.name === SecurityError && e.message === INSECURE_OPERATION) { + // no-op + } else { + // log and ignore, we don't want to break the caller flow, when cache is not available + logError(e, 'openCache failed'); + } } } async function deleteCache(cacheName: string) { try { return await CacheStorageFactory.getCacheStorage().delete(cacheName); } catch (e) { - // log and ignore, we don't want to break the caller flow, when cache is not available - logError(e, 'deleteCache failed'); + // ignoring insecure operation error, as it is thrown in incognito mode in firefox + if (e.name === SecurityError && e.message === INSECURE_OPERATION) { + // no-op + } else { + // log and ignore, we don't want to break the caller flow, when cache is not available + logError(e, 'deleteCache failed'); + } } }