From 70d704aa9a5a91fac655acb7d585838bee4e7c21 Mon Sep 17 00:00:00 2001 From: Jonathan Poltak Samosir Date: Tue, 4 Jun 2024 21:03:42 +0700 Subject: [PATCH] Fix regressed test --- src/background-script/setup.ts | 2 +- src/tests/background-integration-tests.ts | 1 + src/tools/storage-explorer.ts | 5 +++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/background-script/setup.ts b/src/background-script/setup.ts index 3e1a55bd75..d1db22617c 100644 --- a/src/background-script/setup.ts +++ b/src/background-script/setup.ts @@ -176,7 +176,7 @@ export function createBackgroundModules(options: { fetchPDFData: (fullPageUrl: string) => Promise auth?: AuthBackground analyticsManager: Analytics - captureException?: typeof captureException + captureException: typeof captureException // userMessageService?: UserMessageService getNow?: () => number fetch: typeof fetch diff --git a/src/tests/background-integration-tests.ts b/src/tests/background-integration-tests.ts index b1308f2693..0d849fc703 100644 --- a/src/tests/background-integration-tests.ts +++ b/src/tests/background-integration-tests.ts @@ -226,6 +226,7 @@ export async function setupBackgroundIntegrationTest( persistentStorageManager, analyticsManager, localStorageChangesManager: null, + captureException, serverStorage, browserAPIs, services, diff --git a/src/tools/storage-explorer.ts b/src/tools/storage-explorer.ts index 9017e39768..5005da99cc 100644 --- a/src/tools/storage-explorer.ts +++ b/src/tools/storage-explorer.ts @@ -13,6 +13,7 @@ import inMemory from '@worldbrain/storex-backend-dexie/lib/in-memory' import DeprecatedStorageModules from 'src/background-script/deprecated-storage-modules' import { createAuthServices } from 'src/services/local-services' import { CloudflareImageSupportBackend } from '@worldbrain/memex-common/lib/image-support/backend' +import type { ExceptionCapturer } from '@worldbrain/memex-common/lib/firebase-backend/types' type CommandLineArguments = | { command: 'list-collections' } @@ -53,6 +54,9 @@ async function main() { if (typeof window === 'undefined') { global['URL'] = URL } + const captureException: ExceptionCapturer = async (err) => { + console.warn('Got error in content sharing backend', err.message) + } const authServices = createAuthServices({ backend: 'memory', @@ -76,6 +80,7 @@ async function main() { services, analyticsManager: null, storageManager, + captureException, persistentStorageManager, localStorageChangesManager: null, browserAPIs: {