From 229f31f2e6b4fc208a012f61cb34d7c66c9e1b3d Mon Sep 17 00:00:00 2001 From: Tony Giorgio Date: Wed, 5 Jun 2024 13:43:57 -0500 Subject: [PATCH 01/11] Start of sentry integration --- .env.mainnet | 2 +- package.json | 12 ++--- pnpm-lock.yaml | 87 +++++++++++++++++++++++++++++++++++++ src/state/megaStore.tsx | 34 +++++++++++++++ src/workers/walletWorker.ts | 50 +++++++++++++++++++++ 5 files changed, 179 insertions(+), 6 deletions(-) diff --git a/.env.mainnet b/.env.mainnet index 2571e4b80..b07943e36 100644 --- a/.env.mainnet +++ b/.env.mainnet @@ -13,4 +13,4 @@ VITE_FEEDBACK="https://feedback.mutinywallet.com" VITE_SCORER="https://scorer.mutinywallet.com" VITE_PRIMAL="https://primal-cache.mutinywallet.com/api" VITE_BLIND_AUTH="https://blind-auth.mutinywallet.com" -VITE_HERMES="https://mutiny.plus" \ No newline at end of file +VITE_HERMES="https://mutiny.plus" diff --git a/package.json b/package.json index 722a1fcec..8f7054257 100644 --- a/package.json +++ b/package.json @@ -33,11 +33,11 @@ "tailwindcss": "^3.4.1", "typescript": "^5.4.5", "vite": "^5.2.10", + "vite-plugin-comlink": "^4.0.3", "vite-plugin-pwa": "^0.19.8", "vite-plugin-solid": "^2.10.2", "vite-plugin-wasm": "^3.3.0", - "workbox-window": "^7.0.0", - "vite-plugin-comlink": "^4.0.3" + "workbox-window": "^7.0.0" }, "dependencies": { "@capacitor-mlkit/barcode-scanning": "^6.0.0", @@ -55,12 +55,15 @@ "@capacitor/toast": "^6.0.0", "@kobalte/core": "^0.12.6", "@kobalte/tailwindcss": "^0.9.0", - "@mutinywallet/mutiny-wasm": "1.7.5", "@modular-forms/solid": "^0.20.0", + "@mutinywallet/mutiny-wasm": "1.7.5", + "@sentry/browser": "^8.7.0", + "@sentry/wasm": "^8.7.0", "@solid-primitives/upload": "^0.0.117", "@solidjs/meta": "^0.29.3", "@solidjs/router": "^0.13.1", "capacitor-secure-storage-plugin": "^0.9.0", + "comlink": "^4.4.1", "i18next": "^23.10.1", "i18next-browser-languagedetector": "^7.2.0", "i18next-http-backend": "^2.5.0", @@ -68,8 +71,7 @@ "qr-scanner": "^1.4.2", "solid-js": "^1.8.16", "solid-qr-code": "^0.0.8", - "solid-transition-group": "^0.2.3", - "comlink": "^4.4.1" + "solid-transition-group": "^0.2.3" }, "engines": { "node": ">=18" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2455bc7d2..e2e64ab82 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -56,6 +56,12 @@ dependencies: '@mutinywallet/mutiny-wasm': specifier: 1.7.5 version: 1.7.5 + '@sentry/browser': + specifier: ^8.7.0 + version: 8.7.0 + '@sentry/wasm': + specifier: ^8.7.0 + version: 8.7.0 '@solid-primitives/upload': specifier: ^0.0.117 version: 0.0.117(solid-js@1.8.16) @@ -2399,6 +2405,87 @@ packages: dev: true optional: true + /@sentry-internal/browser-utils@8.7.0: + resolution: {integrity: sha512-RFBK1sYBwV5qGMEwWF0rjOTqQpp4/SvE+qHkOJNRUTVYmfjM+Y9lcxwn4B6lu3aboxePpBw/i1PlP6XwX4UnGA==} + engines: {node: '>=14.18'} + dependencies: + '@sentry/core': 8.7.0 + '@sentry/types': 8.7.0 + '@sentry/utils': 8.7.0 + dev: false + + /@sentry-internal/feedback@8.7.0: + resolution: {integrity: sha512-qcGtWCtRB4eP7NVQoxW936oPkU4qu9otMLYELPGmOJPnuAG0lujlJXW7BucaM7ADyJgJTE75hG849bHecfnbmQ==} + engines: {node: '>=14.18'} + dependencies: + '@sentry/core': 8.7.0 + '@sentry/types': 8.7.0 + '@sentry/utils': 8.7.0 + dev: false + + /@sentry-internal/replay-canvas@8.7.0: + resolution: {integrity: sha512-FOnvBPbq6MJVHPduc0hcsdE3PeeovQ2z5WJnZDGhvp/Obehxqe+XgX7K/595vRIknv4EokRn/3Kw0mFwG8E+ZQ==} + engines: {node: '>=14.18'} + dependencies: + '@sentry-internal/replay': 8.7.0 + '@sentry/core': 8.7.0 + '@sentry/types': 8.7.0 + '@sentry/utils': 8.7.0 + dev: false + + /@sentry-internal/replay@8.7.0: + resolution: {integrity: sha512-bQzOkWplaWTe3u+aDBhxWY3Qy0aT7ss2A3VR8iC6N8ZIEP9PxqyJwTNoouhinfgmlnCguI7RDOO4f3r3e2M80Q==} + engines: {node: '>=14.18'} + dependencies: + '@sentry-internal/browser-utils': 8.7.0 + '@sentry/core': 8.7.0 + '@sentry/types': 8.7.0 + '@sentry/utils': 8.7.0 + dev: false + + /@sentry/browser@8.7.0: + resolution: {integrity: sha512-4EEp+PlcktsMN0p+MdCPl/lghTkq7eOtZjQG9NGhWzfyWrJ3tuL1nsDr2SSivJ1V277F01KtKYo6BFwP2NtBZA==} + engines: {node: '>=14.18'} + dependencies: + '@sentry-internal/browser-utils': 8.7.0 + '@sentry-internal/feedback': 8.7.0 + '@sentry-internal/replay': 8.7.0 + '@sentry-internal/replay-canvas': 8.7.0 + '@sentry/core': 8.7.0 + '@sentry/types': 8.7.0 + '@sentry/utils': 8.7.0 + dev: false + + /@sentry/core@8.7.0: + resolution: {integrity: sha512-Sq/46B+5nWmgnCD6dEMZ6HTkKbV/KAdgaSvT8oXDb9OWoPy1jJ/gbLrhLs62KbjuDQk4/vWnOgHiKQbcslSzMw==} + engines: {node: '>=14.18'} + dependencies: + '@sentry/types': 8.7.0 + '@sentry/utils': 8.7.0 + dev: false + + /@sentry/types@8.7.0: + resolution: {integrity: sha512-11KLOKumP6akugVGLvSoEig+JlP0ZEzW3nN9P+ppgdIx9HAxMIh6UvumbieG4/DWjAh2kh6NPNfUw3gk2Gfq1A==} + engines: {node: '>=14.18'} + dev: false + + /@sentry/utils@8.7.0: + resolution: {integrity: sha512-aWmcbSoOmrbzll/FkNQFJcCtLAuJLvTYbRKiCSkV3FScA7UaA742HkTZAPFiioALFIESWk/fcGZqtN0s4I281Q==} + engines: {node: '>=14.18'} + dependencies: + '@sentry/types': 8.7.0 + dev: false + + /@sentry/wasm@8.7.0: + resolution: {integrity: sha512-kxzSR/H7A+h8c28gN4vivrukdk6wphf2Oz0MVQd18up1Fbwqmy226hCuAqZgw7aaPI4gfwatEQFm0Higghr9tA==} + engines: {node: '>=14.18'} + dependencies: + '@sentry/browser': 8.7.0 + '@sentry/core': 8.7.0 + '@sentry/types': 8.7.0 + '@sentry/utils': 8.7.0 + dev: false + /@solid-primitives/event-listener@2.3.3(solid-js@1.8.16): resolution: {integrity: sha512-DAJbl+F0wrFW2xmcV8dKMBhk9QLVLuBSW+TR4JmIfTaObxd13PuL7nqaXnaYKDWOYa6otB00qcCUIGbuIhSUgQ==} peerDependencies: diff --git a/src/state/megaStore.tsx b/src/state/megaStore.tsx index 2ffa58058..21f5dbd9b 100644 --- a/src/state/megaStore.tsx +++ b/src/state/megaStore.tsx @@ -1,9 +1,11 @@ // Inspired by https://github.com/solidjs/solid-realworld/blob/main/src/store/index.js import { MutinyBalance, TagItem } from "@mutinywallet/mutiny-wasm"; +import * as Sentry from "@sentry/browser"; import { useNavigate, useSearchParams } from "@solidjs/router"; import { SecureStoragePlugin } from "capacitor-secure-storage-plugin"; import { Remote } from "comlink"; import { + DEV, createContext, onCleanup, onMount, @@ -41,10 +43,42 @@ type LoadStage = export type WalletWorker = Remote; +const RELEASE_VERSION = import.meta.env.__RELEASE_VERSION__; +const sentryenv = import.meta.env.VITE_SENTRY_ENVIRONMENT || (DEV ? "dev" : "prod"); + export const makeMegaStoreContext = () => { const [searchParams] = useSearchParams(); const navigate = useNavigate(); + // initialize both inside worker and outside + // TODO figure out when to set or not + Sentry.init({ + dsn: "https://192c556849619517322719962a057376@sen.mutinywallet.com/2", + environment: sentryenv, + release: "mutiny-web@" + RELEASE_VERSION, + integrations: [ + Sentry.browserTracingIntegration(), + Sentry.replayIntegration() + ], + + initialScope: { + tags: { component: "main" } + }, + + // Set tracesSampleRate to 1.0 to capture 100% + // of transactions for performance monitoring. + // We recommend adjusting this value in production + tracesSampleRate: 1.0, + + // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled + tracePropagationTargets: ["localhost", /^https:\/\/mutinywallet\.com/], + + // Capture Replay for 10% of all sessions, + // plus 100% of sessions with an error + replaysSessionSampleRate: 0.1, + replaysOnErrorSampleRate: 1.0 + }); + // Not actually a shared worker, but it's the same code const sw = new ComlinkWorker( new URL("../workers/walletWorker", import.meta.url), diff --git a/src/workers/walletWorker.ts b/src/workers/walletWorker.ts index 8a7242a37..3da337778 100644 --- a/src/workers/walletWorker.ts +++ b/src/workers/walletWorker.ts @@ -1,3 +1,4 @@ +import { DEV } from "solid-js"; import initMutinyWallet, { ActivityItem, BudgetPeriod, @@ -17,6 +18,7 @@ import initMutinyWallet, { PendingNwcInvoice, TagItem } from "@mutinywallet/mutiny-wasm"; +import * as Sentry from "@sentry/browser"; import { IActivityItem } from "~/components"; import { MutinyWalletSettingStrings } from "~/logic/mutinyWalletSetup"; @@ -26,6 +28,9 @@ import { MutinyFederationIdentity } from "~/routes/settings"; +const RELEASE_VERSION = import.meta.env.__RELEASE_VERSION__; +const sentryenv = import.meta.env.VITE_SENTRY_ENVIRONMENT || (DEV ? "dev" : "prod"); + // For some reason {...invoice } doesn't bring across the paid field function destructureInvoice(invoice: MutinyInvoice): MutinyInvoice { return { @@ -95,6 +100,51 @@ export async function setupMutinyWallet( shouldZapHodl?: boolean, nsec?: string ): Promise { + // initialize both inside worker and outside + // TODO figure out when to set or not + Sentry.init({ + dsn: "https://192c556849619517322719962a057376@sen.mutinywallet.com/2", + environment: sentryenv, + release: "mutiny-web@" + RELEASE_VERSION, + integrations: [ + Sentry.captureConsoleIntegration(), // grab all mutiny-node console lines + Sentry.browserTracingIntegration(), + Sentry.replayIntegration() + ], + + initialScope: { + tags: { component: "worker" } + }, + + // ignore any hex larger than 20 char + ignoreErrors: [/(?:[0-9a-fA-F]{20,}\b)+/], + + // only do a new issue for errors w/ or w/o exceptions, and warnings + beforeSend(event, hint) { + const error = hint.originalException; + if (error && error.message) { + return event; + } else if (event.level == "warning" || event.level == "error") { + return event; + } else { + return null; + } + }, + + // Set tracesSampleRate to 1.0 to capture 100% + // of transactions for performance monitoring. + // We recommend adjusting this value in production + tracesSampleRate: 1.0, + + // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled + tracePropagationTargets: ["localhost", /^https:\/\/mutinywallet\.com/], + + // Capture Replay for 10% of all sessions, + // plus 100% of sessions with an error + replaysSessionSampleRate: 0.1, + replaysOnErrorSampleRate: 1.0 + }); + console.log("Starting setup..."); const { From 57bdc034c36af5f184bcde1b6f365258f1e205e5 Mon Sep 17 00:00:00 2001 From: Paul Miller Date: Thu, 6 Jun 2024 12:38:22 -0500 Subject: [PATCH 02/11] fix typescript type narrowing --- src/workers/walletWorker.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/workers/walletWorker.ts b/src/workers/walletWorker.ts index 3da337778..fdd9b5b87 100644 --- a/src/workers/walletWorker.ts +++ b/src/workers/walletWorker.ts @@ -1,4 +1,3 @@ -import { DEV } from "solid-js"; import initMutinyWallet, { ActivityItem, BudgetPeriod, @@ -19,6 +18,7 @@ import initMutinyWallet, { TagItem } from "@mutinywallet/mutiny-wasm"; import * as Sentry from "@sentry/browser"; +import { DEV } from "solid-js"; import { IActivityItem } from "~/components"; import { MutinyWalletSettingStrings } from "~/logic/mutinyWalletSetup"; @@ -29,7 +29,8 @@ import { } from "~/routes/settings"; const RELEASE_VERSION = import.meta.env.__RELEASE_VERSION__; -const sentryenv = import.meta.env.VITE_SENTRY_ENVIRONMENT || (DEV ? "dev" : "prod"); +const sentryenv = + import.meta.env.VITE_SENTRY_ENVIRONMENT || (DEV ? "dev" : "prod"); // For some reason {...invoice } doesn't bring across the paid field function destructureInvoice(invoice: MutinyInvoice): MutinyInvoice { @@ -122,7 +123,7 @@ export async function setupMutinyWallet( // only do a new issue for errors w/ or w/o exceptions, and warnings beforeSend(event, hint) { const error = hint.originalException; - if (error && error.message) { + if (error && typeof error === "object" && "message" in error) { return event; } else if (event.level == "warning" || event.level == "error") { return event; From 4f33707a5e903b5eb03f694e90aec400fe7b63bd Mon Sep 17 00:00:00 2001 From: Tony Giorgio Date: Thu, 6 Jun 2024 12:55:13 -0500 Subject: [PATCH 03/11] Toggle diagnostic reporting --- public/i18n/en.json | 6 +- src/components/KitchenSink.tsx | 3 + src/components/ToggleReportDiagnostics.tsx | 46 +++++++++++ src/components/index.ts | 1 + src/state/megaStore.tsx | 76 +++++++++++------- src/workers/walletWorker.ts | 91 ++++++++++++---------- 6 files changed, 149 insertions(+), 74 deletions(-) create mode 100644 src/components/ToggleReportDiagnostics.tsx diff --git a/public/i18n/en.json b/public/i18n/en.json index 0c825e2a6..1f2ba8822 100644 --- a/public/i18n/en.json +++ b/public/i18n/en.json @@ -311,7 +311,11 @@ "enable_zaps_to_hodl": "Enable zaps to hodl invoices?", "zaps_to_hodl_desc": "Zaps to hodl invoices can result in channel force closes, which results in high on-chain fees. Use at your own risk!", "zaps_to_hodl_enable": "Enable hodl zaps", - "zaps_to_hodl_disable": "Disable hodl zaps" + "zaps_to_hodl_disable": "Disable hodl zaps", + "enable_report_diagnostics": "Enable diagnostic reporting?", + "report_diagnostics_desc": "Automatically report critical errors to the developers. All transaction data or other personal information is scrubed and anonymized.", + "report_diagnostics_enable": "Enable diagnostics", + "report_diagnostics_disable": "Disable diagnostics" } }, "backup": { diff --git a/src/components/KitchenSink.tsx b/src/components/KitchenSink.tsx index 88833d651..ade4c0edf 100644 --- a/src/components/KitchenSink.tsx +++ b/src/components/KitchenSink.tsx @@ -24,6 +24,7 @@ import { showToast, SimpleErrorDisplay, ToggleHodl, + ToggleReportDiagnostics, VStack } from "~/components"; import { useI18n } from "~/i18n/context"; @@ -572,6 +573,8 @@ export function KitchenSink() {

+ +
); } diff --git a/src/components/ToggleReportDiagnostics.tsx b/src/components/ToggleReportDiagnostics.tsx new file mode 100644 index 000000000..7d830b38b --- /dev/null +++ b/src/components/ToggleReportDiagnostics.tsx @@ -0,0 +1,46 @@ +import { Button, InnerCard, NiceP, VStack } from "~/components"; +import { useI18n } from "~/i18n/context"; +import { useMegaStore } from "~/state/megaStore"; + +export function ToggleReportDiagnostics() { + const i18n = useI18n(); + const [state, actions] = useMegaStore(); + + async function toggle() { + try { + await actions.toggleReportDiagnostics(); + window.location.href = "/"; + } catch (e) { + console.error(e); + } + } + + return ( + + + + {i18n.t( + "settings.admin.kitchen_sink.report_diagnostics_desc" + )} + + + + + + ); +} diff --git a/src/components/index.ts b/src/components/index.ts index 5706dba8d..62fddc6b7 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -39,6 +39,7 @@ export * from "./Toaster"; export * from "./NostrActivity"; export * from "./MutinyPlusCta"; export * from "./ToggleHodl"; +export * from "./ToggleReportDiagnostics"; export * from "./IOSbanner"; export * from "./HomePrompt"; export * from "./BigMoney"; diff --git a/src/state/megaStore.tsx b/src/state/megaStore.tsx index 21f5dbd9b..76ac2296f 100644 --- a/src/state/megaStore.tsx +++ b/src/state/megaStore.tsx @@ -5,8 +5,8 @@ import { useNavigate, useSearchParams } from "@solidjs/router"; import { SecureStoragePlugin } from "capacitor-secure-storage-plugin"; import { Remote } from "comlink"; import { - DEV, createContext, + DEV, onCleanup, onMount, ParentComponent, @@ -21,7 +21,6 @@ import { MutinyWalletSettingStrings, Network, setSettings - // setupMutinyWallet } from "~/logic/mutinyWalletSetup"; import { ParsedParams, toParsedParams } from "~/logic/waila"; import { MutinyFederationIdentity } from "~/routes/settings"; @@ -44,40 +43,47 @@ type LoadStage = export type WalletWorker = Remote; const RELEASE_VERSION = import.meta.env.__RELEASE_VERSION__; -const sentryenv = import.meta.env.VITE_SENTRY_ENVIRONMENT || (DEV ? "dev" : "prod"); +const sentryenv = + import.meta.env.VITE_SENTRY_ENVIRONMENT || (DEV ? "dev" : "prod"); export const makeMegaStoreContext = () => { const [searchParams] = useSearchParams(); const navigate = useNavigate(); + const reportDiagnostics = + localStorage.getItem("report_diagnostics") === "true"; // initialize both inside worker and outside - // TODO figure out when to set or not - Sentry.init({ - dsn: "https://192c556849619517322719962a057376@sen.mutinywallet.com/2", - environment: sentryenv, - release: "mutiny-web@" + RELEASE_VERSION, - integrations: [ - Sentry.browserTracingIntegration(), - Sentry.replayIntegration() - ], - - initialScope: { - tags: { component: "main" } - }, - - // Set tracesSampleRate to 1.0 to capture 100% - // of transactions for performance monitoring. - // We recommend adjusting this value in production - tracesSampleRate: 1.0, - - // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled - tracePropagationTargets: ["localhost", /^https:\/\/mutinywallet\.com/], - - // Capture Replay for 10% of all sessions, - // plus 100% of sessions with an error - replaysSessionSampleRate: 0.1, - replaysOnErrorSampleRate: 1.0 - }); + if (reportDiagnostics) { + Sentry.init({ + dsn: "https://192c556849619517322719962a057376@sen.mutinywallet.com/2", + environment: sentryenv, + release: "mutiny-web@" + RELEASE_VERSION, + integrations: [ + Sentry.browserTracingIntegration(), + Sentry.replayIntegration() + ], + + initialScope: { + tags: { component: "main" } + }, + + // Set tracesSampleRate to 1.0 to capture 100% + // of transactions for performance monitoring. + // We recommend adjusting this value in production + tracesSampleRate: 1.0, + + // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled + tracePropagationTargets: [ + "localhost", + /^https:\/\/mutinywallet\.com/ + ], + + // Capture Replay for 10% of all sessions, + // plus 100% of sessions with an error + replaysSessionSampleRate: 0.1, + replaysOnErrorSampleRate: 1.0 + }); + } // Not actually a shared worker, but it's the same code const sw = new ComlinkWorker( @@ -118,6 +124,7 @@ export const makeMegaStoreContext = () => { lang: localStorage.getItem("i18nexLng") || undefined, preferredInvoiceType: "unified" as "unified" | "lightning" | "onchain", should_zap_hodl: localStorage.getItem("should_zap_hodl") === "true", + report_diagnostics: reportDiagnostics, testflightPromptDismissed: localStorage.getItem("testflightPromptDismissed") === "true", federations: undefined as MutinyFederationIdentity[] | undefined, @@ -267,6 +274,7 @@ export const makeMegaStoreContext = () => { password, state.safe_mode, state.should_zap_hodl, + state.report_diagnostics, nsec ); @@ -544,6 +552,14 @@ export const makeMegaStoreContext = () => { localStorage.setItem("should_zap_hodl", should_zap_hodl.toString()); setState({ should_zap_hodl }); }, + toggleReportDiagnostics() { + const report_diagnostics = !state.report_diagnostics; + localStorage.setItem( + "report_diagnostics", + report_diagnostics.toString() + ); + setState({ report_diagnostics }); + }, async refreshFederations() { const federations = await sw.list_federations(); diff --git a/src/workers/walletWorker.ts b/src/workers/walletWorker.ts index fdd9b5b87..9bc95fa87 100644 --- a/src/workers/walletWorker.ts +++ b/src/workers/walletWorker.ts @@ -99,52 +99,57 @@ export async function setupMutinyWallet( password?: string, safeMode?: boolean, shouldZapHodl?: boolean, + reportDiagnostics?: boolean, nsec?: string ): Promise { // initialize both inside worker and outside - // TODO figure out when to set or not - Sentry.init({ - dsn: "https://192c556849619517322719962a057376@sen.mutinywallet.com/2", - environment: sentryenv, - release: "mutiny-web@" + RELEASE_VERSION, - integrations: [ - Sentry.captureConsoleIntegration(), // grab all mutiny-node console lines - Sentry.browserTracingIntegration(), - Sentry.replayIntegration() - ], - - initialScope: { - tags: { component: "worker" } - }, - - // ignore any hex larger than 20 char - ignoreErrors: [/(?:[0-9a-fA-F]{20,}\b)+/], - - // only do a new issue for errors w/ or w/o exceptions, and warnings - beforeSend(event, hint) { - const error = hint.originalException; - if (error && typeof error === "object" && "message" in error) { - return event; - } else if (event.level == "warning" || event.level == "error") { - return event; - } else { - return null; - } - }, - - // Set tracesSampleRate to 1.0 to capture 100% - // of transactions for performance monitoring. - // We recommend adjusting this value in production - tracesSampleRate: 1.0, - - // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled - tracePropagationTargets: ["localhost", /^https:\/\/mutinywallet\.com/], - - // Capture Replay for 10% of all sessions, - // plus 100% of sessions with an error - replaysSessionSampleRate: 0.1, - replaysOnErrorSampleRate: 1.0 - }); + if (reportDiagnostics) { + Sentry.init({ + dsn: "https://192c556849619517322719962a057376@sen.mutinywallet.com/2", + environment: sentryenv, + release: "mutiny-web@" + RELEASE_VERSION, + integrations: [ + Sentry.captureConsoleIntegration(), // grab all mutiny-node console lines + Sentry.browserTracingIntegration(), + Sentry.replayIntegration() + ], + + initialScope: { + tags: { component: "worker" } + }, + + // ignore any hex larger than 20 char + ignoreErrors: [/(?:[0-9a-fA-F]{20,}\b)+/], + + // only do a new issue for errors w/ or w/o exceptions, and warnings + beforeSend(event, hint) { + const error = hint.originalException; + if (error && typeof error === "object" && "message" in error) { + return event; + } else if (event.level == "warning" || event.level == "error") { + return event; + } else { + return null; + } + }, + + // Set tracesSampleRate to 1.0 to capture 100% + // of transactions for performance monitoring. + // We recommend adjusting this value in production + tracesSampleRate: 1.0, + + // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled + tracePropagationTargets: [ + "localhost", + /^https:\/\/mutinywallet\.com/ + ], + + // Capture Replay for 10% of all sessions, + // plus 100% of sessions with an error + replaysSessionSampleRate: 0.1, + replaysOnErrorSampleRate: 1.0 + }); + } console.log("Starting setup..."); From 9bd19f9ae95a9cec59eaca94f472f41d994ca649 Mon Sep 17 00:00:00 2001 From: Tony Giorgio Date: Thu, 6 Jun 2024 14:01:12 -0500 Subject: [PATCH 04/11] Change matrix link to discord --- src/routes/settings/EmergencyKit.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/settings/EmergencyKit.tsx b/src/routes/settings/EmergencyKit.tsx index f3ef5ee1c..60ab790f4 100644 --- a/src/routes/settings/EmergencyKit.tsx +++ b/src/routes/settings/EmergencyKit.tsx @@ -39,7 +39,7 @@ export function EmergencyKit() { {i18n.t("settings.emergency_kit.emergency_tip")} {i18n.t("settings.emergency_kit.questions")}{" "} - + {i18n.t("settings.emergency_kit.link")} From b47b519899fa62f59ef55a779d4db2122c00531f Mon Sep 17 00:00:00 2001 From: Tony Giorgio Date: Thu, 6 Jun 2024 14:04:45 -0500 Subject: [PATCH 05/11] Move diagnostics to emergency kit --- src/components/KitchenSink.tsx | 3 --- src/routes/settings/EmergencyKit.tsx | 2 ++ 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/components/KitchenSink.tsx b/src/components/KitchenSink.tsx index ade4c0edf..88833d651 100644 --- a/src/components/KitchenSink.tsx +++ b/src/components/KitchenSink.tsx @@ -24,7 +24,6 @@ import { showToast, SimpleErrorDisplay, ToggleHodl, - ToggleReportDiagnostics, VStack } from "~/components"; import { useI18n } from "~/i18n/context"; @@ -573,8 +572,6 @@ export function KitchenSink() {

- -
); } diff --git a/src/routes/settings/EmergencyKit.tsx b/src/routes/settings/EmergencyKit.tsx index 60ab790f4..e5bca1621 100644 --- a/src/routes/settings/EmergencyKit.tsx +++ b/src/routes/settings/EmergencyKit.tsx @@ -10,6 +10,7 @@ import { NavBar, NiceP, SmallHeader, + ToggleReportDiagnostics, VStack } from "~/components"; import { useI18n } from "~/i18n/context"; @@ -19,6 +20,7 @@ function EmergencyStack() { return ( +
{i18n.t("settings.danger_zone")} From 0c9617d20026844a75eaae515f9ec43ae6c4cce7 Mon Sep 17 00:00:00 2001 From: Tony Giorgio Date: Thu, 6 Jun 2024 14:41:37 -0500 Subject: [PATCH 06/11] Require sentry environment variable --- src/state/megaStore.tsx | 5 ++--- src/workers/walletWorker.ts | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/state/megaStore.tsx b/src/state/megaStore.tsx index 76ac2296f..c87072454 100644 --- a/src/state/megaStore.tsx +++ b/src/state/megaStore.tsx @@ -43,8 +43,7 @@ type LoadStage = export type WalletWorker = Remote; const RELEASE_VERSION = import.meta.env.__RELEASE_VERSION__; -const sentryenv = - import.meta.env.VITE_SENTRY_ENVIRONMENT || (DEV ? "dev" : "prod"); +const sentryenv = import.meta.env.VITE_SENTRY_ENVIRONMENT || (DEV ? "dev" : ""); export const makeMegaStoreContext = () => { const [searchParams] = useSearchParams(); @@ -53,7 +52,7 @@ export const makeMegaStoreContext = () => { localStorage.getItem("report_diagnostics") === "true"; // initialize both inside worker and outside - if (reportDiagnostics) { + if (reportDiagnostics && sentryenv !== "") { Sentry.init({ dsn: "https://192c556849619517322719962a057376@sen.mutinywallet.com/2", environment: sentryenv, diff --git a/src/workers/walletWorker.ts b/src/workers/walletWorker.ts index 9bc95fa87..7ebf584a6 100644 --- a/src/workers/walletWorker.ts +++ b/src/workers/walletWorker.ts @@ -29,8 +29,7 @@ import { } from "~/routes/settings"; const RELEASE_VERSION = import.meta.env.__RELEASE_VERSION__; -const sentryenv = - import.meta.env.VITE_SENTRY_ENVIRONMENT || (DEV ? "dev" : "prod"); +const sentryenv = import.meta.env.VITE_SENTRY_ENVIRONMENT || (DEV ? "dev" : ""); // For some reason {...invoice } doesn't bring across the paid field function destructureInvoice(invoice: MutinyInvoice): MutinyInvoice { @@ -103,7 +102,7 @@ export async function setupMutinyWallet( nsec?: string ): Promise { // initialize both inside worker and outside - if (reportDiagnostics) { + if (reportDiagnostics && sentryenv !== "") { Sentry.init({ dsn: "https://192c556849619517322719962a057376@sen.mutinywallet.com/2", environment: sentryenv, From 514aa45ab10fdb6d02005bea1e3df60b4a4a72ed Mon Sep 17 00:00:00 2001 From: Tony Giorgio Date: Thu, 6 Jun 2024 14:59:54 -0500 Subject: [PATCH 07/11] Sourcemap configs --- .gitignore | 3 + package.json | 1 + pnpm-lock.yaml | 238 +++++++++++++++++++++++++++++++++++++------------ vite.config.ts | 16 +++- 4 files changed, 198 insertions(+), 60 deletions(-) diff --git a/.gitignore b/.gitignore index 2353c1e8f..ac44905ad 100644 --- a/.gitignore +++ b/.gitignore @@ -35,3 +35,6 @@ dev-dist /playwright/.cache/ .env + +# Sentry Config File +.env.sentry-build-plugin diff --git a/package.json b/package.json index 8f7054257..73dca5285 100644 --- a/package.json +++ b/package.json @@ -58,6 +58,7 @@ "@modular-forms/solid": "^0.20.0", "@mutinywallet/mutiny-wasm": "1.7.5", "@sentry/browser": "^8.7.0", + "@sentry/vite-plugin": "^2.18.0", "@sentry/wasm": "^8.7.0", "@solid-primitives/upload": "^0.0.117", "@solidjs/meta": "^0.29.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e2e64ab82..6da9e0dd1 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -59,6 +59,9 @@ dependencies: '@sentry/browser': specifier: ^8.7.0 version: 8.7.0 + '@sentry/vite-plugin': + specifier: ^2.18.0 + version: 2.18.0 '@sentry/wasm': specifier: ^8.7.0 version: 8.7.0 @@ -190,7 +193,6 @@ packages: dependencies: '@jridgewell/gen-mapping': 0.3.5 '@jridgewell/trace-mapping': 0.3.25 - dev: true /@apideck/better-ajv-errors@0.3.6(ajv@8.12.0): resolution: {integrity: sha512-P+ZygBLZtkp0qqOAJJVX4oX/sFo5JR3eBWwwuqHHhK0GIgQOKWrAfiAaWX0aArHkRWHMuggFEgAZNxVPwPZYaA==} @@ -210,12 +212,10 @@ packages: dependencies: '@babel/highlight': 7.24.2 picocolors: 1.0.0 - dev: true /@babel/compat-data@7.24.1: resolution: {integrity: sha512-Pc65opHDliVpRHuKfzI+gSA4zcgr65O4cl64fFJIWEEh8JoHIHh0Oez1Eo8Arz8zq/JhgKodQaxEwUPRtZylVA==} engines: {node: '>=6.9.0'} - dev: true /@babel/core@7.24.3: resolution: {integrity: sha512-5FcvN1JHw2sHJChotgx8Ek0lyuh4kCKelgMTTqhYJJtloNvUfpAFMeNQUtdlIaktwrSV9LtCdqwk48wL2wBacQ==} @@ -238,7 +238,6 @@ packages: semver: 6.3.1 transitivePeerDependencies: - supports-color - dev: true /@babel/generator@7.24.1: resolution: {integrity: sha512-DfCRfZsBcrPEHUfuBMgbJ1Ut01Y/itOs+hY2nFLgqsqXd52/iSiVq5TITtUasIUgm+IIKdY2/1I7auiQOEeC9A==} @@ -248,7 +247,6 @@ packages: '@jridgewell/gen-mapping': 0.3.5 '@jridgewell/trace-mapping': 0.3.25 jsesc: 2.5.2 - dev: true /@babel/helper-annotate-as-pure@7.22.5: resolution: {integrity: sha512-LvBTxu8bQSQkcyKOU+a1btnNFQ1dMAd0R6PyW3arXes06F6QLWLIrd681bxRPIXlrMGR3XYnW9JyML7dP3qgxg==} @@ -273,7 +271,6 @@ packages: browserslist: 4.23.0 lru-cache: 5.1.1 semver: 6.3.1 - dev: true /@babel/helper-create-class-features-plugin@7.24.1(@babel/core@7.24.3): resolution: {integrity: sha512-1yJa9dX9g//V6fDebXoEfEsxkZHk3Hcbm+zLhyu6qVgYFLvmTALTeV+jNU9e5RnYtioBrGEOdoI2joMSNQ/+aA==} @@ -323,7 +320,6 @@ packages: /@babel/helper-environment-visitor@7.22.20: resolution: {integrity: sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==} engines: {node: '>=6.9.0'} - dev: true /@babel/helper-function-name@7.23.0: resolution: {integrity: sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==} @@ -331,14 +327,12 @@ packages: dependencies: '@babel/template': 7.24.0 '@babel/types': 7.24.0 - dev: true /@babel/helper-hoist-variables@7.22.5: resolution: {integrity: sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==} engines: {node: '>=6.9.0'} dependencies: '@babel/types': 7.24.0 - dev: true /@babel/helper-member-expression-to-functions@7.23.0: resolution: {integrity: sha512-6gfrPwh7OuT6gZyJZvd6WbTfrqAo7vm4xCzAXOusKqq/vWdKXphTpj5klHKNmRUU6/QRGlBsyU9mAIPaWHlqJA==} @@ -359,7 +353,6 @@ packages: engines: {node: '>=6.9.0'} dependencies: '@babel/types': 7.24.0 - dev: true /@babel/helper-module-transforms@7.23.3(@babel/core@7.24.3): resolution: {integrity: sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ==} @@ -373,7 +366,6 @@ packages: '@babel/helper-simple-access': 7.22.5 '@babel/helper-split-export-declaration': 7.22.6 '@babel/helper-validator-identifier': 7.22.20 - dev: true /@babel/helper-optimise-call-expression@7.22.5: resolution: {integrity: sha512-HBwaojN0xFRx4yIvpwGqxiV2tUfl7401jlok564NgB9EHS1y6QT17FmKWm4ztqjeVdXLuC4fSvHc5ePpQjoTbw==} @@ -416,7 +408,6 @@ packages: engines: {node: '>=6.9.0'} dependencies: '@babel/types': 7.24.0 - dev: true /@babel/helper-skip-transparent-expression-wrappers@7.22.5: resolution: {integrity: sha512-tK14r66JZKiC43p8Ki33yLBVJKlQDFoA8GYN67lWCDCqoL6EMMSuM9b+Iff2jHaM/RRFYl7K+iiru7hbRqNx8Q==} @@ -430,22 +421,18 @@ packages: engines: {node: '>=6.9.0'} dependencies: '@babel/types': 7.24.0 - dev: true /@babel/helper-string-parser@7.24.1: resolution: {integrity: sha512-2ofRCjnnA9y+wk8b9IAREroeUP02KHp431N2mhKniy2yKIDKpbrHv9eXwm8cBeWQYcJmzv5qKCu65P47eCF7CQ==} engines: {node: '>=6.9.0'} - dev: true /@babel/helper-validator-identifier@7.22.20: resolution: {integrity: sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==} engines: {node: '>=6.9.0'} - dev: true /@babel/helper-validator-option@7.23.5: resolution: {integrity: sha512-85ttAOMLsr53VgXkTbkx8oA6YTfT4q7/HzXSLEYmjcSTJPMPQtvq1BD79Byep5xMUYbGRzEpDsjUf3dyp54IKw==} engines: {node: '>=6.9.0'} - dev: true /@babel/helper-wrap-function@7.22.20: resolution: {integrity: sha512-pms/UwkOpnQe/PDAEdV/d7dVCoBbB+R4FvYoHGZz+4VPcg7RtYy2KP7S2lbuWM6FCSgob5wshfGESbC/hzNXZw==} @@ -465,7 +452,6 @@ packages: '@babel/types': 7.24.0 transitivePeerDependencies: - supports-color - dev: true /@babel/highlight@7.24.2: resolution: {integrity: sha512-Yac1ao4flkTxTteCDZLEvdxg2fZfz1v8M4QpaGypq/WPDqg3ijHYbDfs+LG5hvzSoqaSZ9/Z9lKSP3CjZjv+pA==} @@ -475,7 +461,6 @@ packages: chalk: 2.4.2 js-tokens: 4.0.0 picocolors: 1.0.0 - dev: true /@babel/parser@7.24.1: resolution: {integrity: sha512-Zo9c7N3xdOIQrNip7Lc9wvRPzlRtovHVE4lkz8WEDr7uYh/GMQhSiIgFxGIArRHYdJE5kxtZjAf8rT0xhdLCzg==} @@ -483,7 +468,6 @@ packages: hasBin: true dependencies: '@babel/types': 7.24.0 - dev: true /@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@7.24.1(@babel/core@7.24.3): resolution: {integrity: sha512-y4HqEnkelJIOQGd+3g1bTeKsA5c6qM7eOn7VggGVbBc0y8MLSKHacwcIE2PplNlQSj0PqS9rrXL/nkPVK+kUNg==} @@ -1356,7 +1340,6 @@ packages: '@babel/code-frame': 7.24.2 '@babel/parser': 7.24.1 '@babel/types': 7.24.0 - dev: true /@babel/traverse@7.24.1: resolution: {integrity: sha512-xuU6o9m68KeqZbQuDt2TcKSxUw/mrsvavlEqQ1leZ/B+C9tk6E4sRWy97WaXgvq5E+nU3cXMxv3WKOCanVMCmQ==} @@ -1374,7 +1357,6 @@ packages: globals: 11.12.0 transitivePeerDependencies: - supports-color - dev: true /@babel/types@7.24.0: resolution: {integrity: sha512-+j7a5c253RfKh8iABBhywc8NSfP5LURe7Uh4qpsh6jc+aLJguvmIUBdjSdEMQv2bENrCR5MfRdjGo7vzS/ob7w==} @@ -1383,7 +1365,6 @@ packages: '@babel/helper-string-parser': 7.24.1 '@babel/helper-validator-identifier': 7.22.20 to-fast-properties: 2.0.0 - dev: true /@capacitor-mlkit/barcode-scanning@6.0.0(@capacitor/core@6.0.0): resolution: {integrity: sha512-zW5UKgFtUui9qFV8PBxPzX+07gntyt5owW4S/GhOt4xWGaoxDZWERaA+XJnXgmMxS/MnPIHX2mL+mhMd1A0enQ==} @@ -2443,6 +2424,11 @@ packages: '@sentry/utils': 8.7.0 dev: false + /@sentry/babel-plugin-component-annotate@2.18.0: + resolution: {integrity: sha512-9L4RbhS3WNtc/SokIhc0dwgcvs78YSQPakZejsrIgnzLzCi8mS6PeT+BY0+QCtsXxjd1egM8hqcJeB0lukBkXA==} + engines: {node: '>= 14'} + dev: false + /@sentry/browser@8.7.0: resolution: {integrity: sha512-4EEp+PlcktsMN0p+MdCPl/lghTkq7eOtZjQG9NGhWzfyWrJ3tuL1nsDr2SSivJ1V277F01KtKYo6BFwP2NtBZA==} engines: {node: '>=14.18'} @@ -2456,6 +2442,109 @@ packages: '@sentry/utils': 8.7.0 dev: false + /@sentry/bundler-plugin-core@2.18.0: + resolution: {integrity: sha512-JvxVgsMFmDsU0Dgcx1CeFUC1scxOVSAOzOcE06qKAVm9BZzxHpI53iNfeMOXwVTUolD8LZVIfgOjkiXfwN/UPQ==} + engines: {node: '>= 14'} + dependencies: + '@babel/core': 7.24.3 + '@sentry/babel-plugin-component-annotate': 2.18.0 + '@sentry/cli': 2.32.1 + dotenv: 16.4.5 + find-up: 5.0.0 + glob: 9.3.5 + magic-string: 0.30.8 + unplugin: 1.0.1 + transitivePeerDependencies: + - encoding + - supports-color + dev: false + + /@sentry/cli-darwin@2.32.1: + resolution: {integrity: sha512-z/lEwANTYPCzbWTZ2+eeeNYxRLllC8knd0h+vtAKlhmGw/fyc/N39cznIFyFu+dLJ6tTdjOWOeikHtKuS/7onw==} + engines: {node: '>=10'} + os: [darwin] + requiresBuild: true + dev: false + optional: true + + /@sentry/cli-linux-arm64@2.32.1: + resolution: {integrity: sha512-hsGqHYuecUl1Yhq4MhiRejfh1gNlmhyNPcQEoO/DDRBnGnJyEAdiDpKXJcc2e/lT9k40B55Ob2CP1SeY040T2w==} + engines: {node: '>=10'} + cpu: [arm64] + os: [linux, freebsd] + requiresBuild: true + dev: false + optional: true + + /@sentry/cli-linux-arm@2.32.1: + resolution: {integrity: sha512-m0lHkn+o4YKBq8KptGZvpT64FAwSl9mYvHZO9/ChnEGIJ/WyJwiN1X1r9JHVaW4iT5lD0Y5FAyq3JLkk0m0XHg==} + engines: {node: '>=10'} + cpu: [arm] + os: [linux, freebsd] + requiresBuild: true + dev: false + optional: true + + /@sentry/cli-linux-i686@2.32.1: + resolution: {integrity: sha512-SuMLN1/ceFd3Q/B0DVyh5igjetTAF423txiABAHASenEev0lG0vZkRDXFclfgDtDUKRPmOXW7VDMirM3yZWQHQ==} + engines: {node: '>=10'} + cpu: [x86, ia32] + os: [linux, freebsd] + requiresBuild: true + dev: false + optional: true + + /@sentry/cli-linux-x64@2.32.1: + resolution: {integrity: sha512-x4FGd6xgvFddz8V/dh6jii4wy9qjWyvYLBTz8Fhi9rIP+b8wQ3oxwHIdzntareetZP7C1ggx+hZheiYocNYVwA==} + engines: {node: '>=10'} + cpu: [x64] + os: [linux, freebsd] + requiresBuild: true + dev: false + optional: true + + /@sentry/cli-win32-i686@2.32.1: + resolution: {integrity: sha512-i6aZma9mFzR+hqMY5VliQZEX6ypP/zUjPK0VtIMYWs5cC6PsQLRmuoeJmy3Z7d4nlh0CdK5NPC813Ej6RY6/vg==} + engines: {node: '>=10'} + cpu: [x86, ia32] + os: [win32] + requiresBuild: true + dev: false + optional: true + + /@sentry/cli-win32-x64@2.32.1: + resolution: {integrity: sha512-B58w/lRHLb4MUSjJNfMMw2cQykfimDCMLMmeK+1EiT2RmSeNQliwhhBxYcKk82a8kszH6zg3wT2vCea7LyPUyA==} + engines: {node: '>=10'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: false + optional: true + + /@sentry/cli@2.32.1: + resolution: {integrity: sha512-MWkbkzZfnlE7s2pPbg4VozRSAeMlIObfZlTIou9ye6XnPt6ZmmxCLOuOgSKMv4sXg6aeqKNzMNiadThxCWyvPg==} + engines: {node: '>= 10'} + hasBin: true + requiresBuild: true + dependencies: + https-proxy-agent: 5.0.1 + node-fetch: 2.7.0 + progress: 2.0.3 + proxy-from-env: 1.1.0 + which: 2.0.2 + optionalDependencies: + '@sentry/cli-darwin': 2.32.1 + '@sentry/cli-linux-arm': 2.32.1 + '@sentry/cli-linux-arm64': 2.32.1 + '@sentry/cli-linux-i686': 2.32.1 + '@sentry/cli-linux-x64': 2.32.1 + '@sentry/cli-win32-i686': 2.32.1 + '@sentry/cli-win32-x64': 2.32.1 + transitivePeerDependencies: + - encoding + - supports-color + dev: false + /@sentry/core@8.7.0: resolution: {integrity: sha512-Sq/46B+5nWmgnCD6dEMZ6HTkKbV/KAdgaSvT8oXDb9OWoPy1jJ/gbLrhLs62KbjuDQk4/vWnOgHiKQbcslSzMw==} engines: {node: '>=14.18'} @@ -2476,6 +2565,17 @@ packages: '@sentry/types': 8.7.0 dev: false + /@sentry/vite-plugin@2.18.0: + resolution: {integrity: sha512-yY8QSvbMjRpG5pzN6lnW5guZhyTDSGeWwM9tDyT9ix/ShODy/eE6jErisBtlo50lFJuew7x79WXnVykvds4Ddg==} + engines: {node: '>= 14'} + dependencies: + '@sentry/bundler-plugin-core': 2.18.0 + unplugin: 1.0.1 + transitivePeerDependencies: + - encoding + - supports-color + dev: false + /@sentry/wasm@8.7.0: resolution: {integrity: sha512-kxzSR/H7A+h8c28gN4vivrukdk6wphf2Oz0MVQd18up1Fbwqmy226hCuAqZgw7aaPI4gfwatEQFm0Higghr9tA==} engines: {node: '>=14.18'} @@ -3014,12 +3114,20 @@ packages: resolution: {integrity: sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==} engines: {node: '>=0.4.0'} hasBin: true - dev: true /add-stream@1.0.0: resolution: {integrity: sha512-qQLMr+8o0WC4FZGQTcJiKBVC59JylcPSrTtk6usvmIDFUOCKegapy1VHQwRbFMOFyb/inzUVqHs+eMYKDM1YeQ==} dev: true + /agent-base@6.0.2: + resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} + engines: {node: '>= 6.0.0'} + dependencies: + debug: 4.3.4 + transitivePeerDependencies: + - supports-color + dev: false + /aggregate-error@3.1.0: resolution: {integrity: sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==} engines: {node: '>=8'} @@ -3059,7 +3167,6 @@ packages: engines: {node: '>=4'} dependencies: color-convert: 1.9.3 - dev: true /ansi-styles@4.3.0: resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} @@ -3384,7 +3491,6 @@ packages: electron-to-chromium: 1.4.715 node-releases: 2.0.14 update-browserslist-db: 1.0.13(browserslist@4.23.0) - dev: true /buffer-crc32@0.2.13: resolution: {integrity: sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==} @@ -3442,7 +3548,6 @@ packages: /caniuse-lite@1.0.30001600: resolution: {integrity: sha512-+2S9/2JFhYmYaDpZvo0lKkfvuKIglrx68MwOBqMGHhQsNkLjB5xtc/TGoEPs+MxjSyN/72qer2g97nzR641mOQ==} - dev: true /capacitor-secure-storage-plugin@0.9.0(@capacitor/core@6.0.0): resolution: {integrity: sha512-P5fiC94opcLHu41vceo9weXH+20g0SPYKkeAx+qm9eKNcVFqpcuI4dqwivXlGXYNMDygyjSQuAaFwZ4gW0Y91Q==} @@ -3459,7 +3564,6 @@ packages: ansi-styles: 3.2.1 escape-string-regexp: 1.0.5 supports-color: 5.5.0 - dev: true /chalk@4.1.2: resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} @@ -3532,7 +3636,6 @@ packages: resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==} dependencies: color-name: 1.1.3 - dev: true /color-convert@2.0.1: resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} @@ -3542,7 +3645,6 @@ packages: /color-name@1.1.3: resolution: {integrity: sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==} - dev: true /color-name@1.1.4: resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} @@ -3747,7 +3849,6 @@ packages: /convert-source-map@2.0.0: resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} - dev: true /core-js-compat@3.36.1: resolution: {integrity: sha512-Dk997v9ZCt3X/npqzyGdTlq6t7lDBhZwGvV94PKzDArjp7BTRm7WlDAXYd/OWdeFHO8OChQYRJNJvUCqCbrtKA==} @@ -3873,7 +3974,6 @@ packages: optional: true dependencies: ms: 2.1.2 - dev: true /decamelize-keys@1.1.1: resolution: {integrity: sha512-WiPxgEirIV0/eIOMcnFBA3/IJZAZqKnwAwWyvvdi4lsr1WCN22nhdf/3db3DoZcUjTV2SqfzIwNyp6y2xs3nmg==} @@ -4022,6 +4122,11 @@ packages: is-obj: 2.0.0 dev: true + /dotenv@16.4.5: + resolution: {integrity: sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==} + engines: {node: '>=12'} + dev: false + /eastasianwidth@0.2.0: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} @@ -4035,7 +4140,6 @@ packages: /electron-to-chromium@1.4.715: resolution: {integrity: sha512-XzWNH4ZSa9BwVUQSDorPWAUQ5WGuYz7zJUNpNif40zFCiCl20t8zgylmreNmn26h5kiyw2lg7RfTmeMBsDklqg==} - dev: true /elementtree@0.1.7: resolution: {integrity: sha512-wkgGT6kugeQk/P6VZ/f4T+4HB41BVgNBq5CDIZVbQ02nvTVqAiVTbskxxu3eA/X96lMlfYOwnLQpN2v5E1zDEg==} @@ -4213,12 +4317,10 @@ packages: /escalade@3.1.2: resolution: {integrity: sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==} engines: {node: '>=6'} - dev: true /escape-string-regexp@1.0.5: resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==} engines: {node: '>=0.8.0'} - dev: true /escape-string-regexp@4.0.0: resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} @@ -4543,7 +4645,6 @@ packages: dependencies: locate-path: 6.0.0 path-exists: 4.0.0 - dev: true /flat-cache@3.2.0: resolution: {integrity: sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==} @@ -4612,7 +4713,6 @@ packages: /fs.realpath@1.0.0: resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} - dev: true /fsevents@2.3.2: resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==} @@ -4649,7 +4749,6 @@ packages: /gensync@1.0.0-beta.2: resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} engines: {node: '>=6.9.0'} - dev: true /get-caller-file@2.0.5: resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} @@ -4778,12 +4877,10 @@ packages: minimatch: 8.0.4 minipass: 4.2.8 path-scurry: 1.10.1 - dev: true /globals@11.12.0: resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} engines: {node: '>=4'} - dev: true /globals@13.24.0: resolution: {integrity: sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==} @@ -4857,7 +4954,6 @@ packages: /has-flag@3.0.0: resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==} engines: {node: '>=4'} - dev: true /has-flag@4.0.0: resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} @@ -4918,6 +5014,16 @@ packages: engines: {node: '>=8'} dev: true + /https-proxy-agent@5.0.1: + resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} + engines: {node: '>= 6'} + dependencies: + agent-base: 6.0.2 + debug: 4.3.4 + transitivePeerDependencies: + - supports-color + dev: false + /i18next-browser-languagedetector@7.2.0: resolution: {integrity: sha512-U00DbDtFIYD3wkWsr2aVGfXGAj2TgnELzOX9qv8bT0aJtvPV9CRO77h+vgmHFBMe7LAxdwvT/7VkCWGya6L3tA==} dependencies: @@ -5259,7 +5365,6 @@ packages: /js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - dev: true /js-yaml@4.1.0: resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} @@ -5277,7 +5382,6 @@ packages: resolution: {integrity: sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==} engines: {node: '>=4'} hasBin: true - dev: true /json-buffer@3.0.1: resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==} @@ -5322,7 +5426,6 @@ packages: resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==} engines: {node: '>=6'} hasBin: true - dev: true /jsonfile@6.1.0: resolution: {integrity: sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==} @@ -5425,7 +5528,6 @@ packages: engines: {node: '>=10'} dependencies: p-locate: 5.0.0 - dev: true /lodash.debounce@4.0.8: resolution: {integrity: sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==} @@ -5455,7 +5557,6 @@ packages: resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==} dependencies: yallist: 3.1.1 - dev: true /lru-cache@6.0.0: resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==} @@ -5485,6 +5586,13 @@ packages: '@jridgewell/sourcemap-codec': 1.4.15 dev: true + /magic-string@0.30.8: + resolution: {integrity: sha512-ISQTe55T2ao7XtlAStud6qwYPZjE4GK1S/BeVPus4jrq6JuOnQ00YKQC581RWhR122W7msZV263KzVeLoqidyQ==} + engines: {node: '>=12'} + dependencies: + '@jridgewell/sourcemap-codec': 1.4.15 + dev: false + /make-error@1.3.6: resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==} dev: true @@ -5580,7 +5688,6 @@ packages: engines: {node: '>=16 || 14 >=14.17'} dependencies: brace-expansion: 2.0.1 - dev: true /minimatch@9.0.3: resolution: {integrity: sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==} @@ -5618,7 +5725,6 @@ packages: /minipass@4.2.8: resolution: {integrity: sha512-fNzuVyifolSLFL4NzpF+wEF4qrgqaaKX0haXPQEdQ7NKAN+WecoKMHV09YcuL/DHxrUsYQOK3MiuDf7Ip2OXfQ==} engines: {node: '>=8'} - dev: true /minipass@5.0.0: resolution: {integrity: sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==} @@ -5654,7 +5760,6 @@ packages: /ms@2.1.2: resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} - dev: true /ms@2.1.3: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} @@ -5735,7 +5840,6 @@ packages: /node-releases@2.0.14: resolution: {integrity: sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==} - dev: true /nodemon@2.0.22: resolution: {integrity: sha512-B8YqaKMmyuCO7BowF1Z1/mkPqLk6cs/l63Ojtd6otKjMx47Dq1utxfRxcavH1I7VSaL8n5BUaoutadnsX3AAVQ==} @@ -5904,7 +6008,6 @@ packages: engines: {node: '>=10'} dependencies: yocto-queue: 0.1.0 - dev: true /p-locate@2.0.0: resolution: {integrity: sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg==} @@ -5925,7 +6028,6 @@ packages: engines: {node: '>=10'} dependencies: p-limit: 3.1.0 - dev: true /p-map@4.0.0: resolution: {integrity: sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==} @@ -5977,7 +6079,6 @@ packages: /path-exists@4.0.0: resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} engines: {node: '>=8'} - dev: true /path-is-absolute@1.0.1: resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} @@ -6240,6 +6341,11 @@ packages: resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==} dev: true + /progress@2.0.3: + resolution: {integrity: sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==} + engines: {node: '>=0.4.0'} + dev: false + /prompts@2.4.2: resolution: {integrity: sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==} engines: {node: '>= 6'} @@ -6248,6 +6354,10 @@ packages: sisteransi: 1.0.5 dev: true + /proxy-from-env@1.1.0: + resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} + dev: false + /pstree.remy@1.1.8: resolution: {integrity: sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==} dev: true @@ -6588,7 +6698,6 @@ packages: /semver@6.3.1: resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} hasBin: true - dev: true /semver@7.0.0: resolution: {integrity: sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==} @@ -7021,7 +7130,6 @@ packages: engines: {node: '>=4'} dependencies: has-flag: 3.0.0 - dev: true /supports-color@7.2.0: resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} @@ -7209,7 +7317,6 @@ packages: /to-fast-properties@2.0.0: resolution: {integrity: sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==} engines: {node: '>=4'} - dev: true /to-regex-range@5.0.1: resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} @@ -7446,6 +7553,15 @@ packages: engines: {node: '>= 10.0.0'} dev: true + /unplugin@1.0.1: + resolution: {integrity: sha512-aqrHaVBWW1JVKBHmGo33T5TxeL0qWzfvjWokObHA9bYmN7eNDkwOxmLjhioHl9878qDFMAaT51XNroRyuz7WxA==} + dependencies: + acorn: 8.11.3 + chokidar: 3.6.0 + webpack-sources: 3.2.3 + webpack-virtual-modules: 0.5.0 + dev: false + /untildify@4.0.0: resolution: {integrity: sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==} engines: {node: '>=8'} @@ -7465,7 +7581,6 @@ packages: browserslist: 4.23.0 escalade: 3.1.2 picocolors: 1.0.0 - dev: true /uri-js@4.4.1: resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} @@ -7615,6 +7730,15 @@ packages: resolution: {integrity: sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==} dev: true + /webpack-sources@3.2.3: + resolution: {integrity: sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==} + engines: {node: '>=10.13.0'} + dev: false + + /webpack-virtual-modules@0.5.0: + resolution: {integrity: sha512-kyDivFZ7ZM0BVOUteVbDFhlRt7Ah/CSPwJdi8hBpkK7QLumUqdLtVfm/PX/hkcnrvr0i77fO5+TjZ94Pe+C9iw==} + dev: false + /whatwg-url@5.0.0: resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} dependencies: @@ -7900,7 +8024,6 @@ packages: /yallist@3.1.1: resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==} - dev: true /yallist@4.0.0: resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} @@ -7987,4 +8110,3 @@ packages: /yocto-queue@0.1.0: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} - dev: true diff --git a/vite.config.ts b/vite.config.ts index 4ebd3b12a..13a5e4766 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,5 +1,6 @@ import child from "node:child_process"; import path from "node:path"; +import { sentryVitePlugin } from "@sentry/vite-plugin"; import { defineConfig } from "vite"; import { comlink } from "vite-plugin-comlink"; import { VitePWA, VitePWAOptions } from "vite-plugin-pwa"; @@ -32,7 +33,8 @@ export default defineConfig({ build: { target: "esnext", outDir: "dist/public", - emptyOutDir: true + emptyOutDir: true, + sourcemap: true }, server: { port: 3420, @@ -41,7 +43,17 @@ export default defineConfig({ allow: [".."] } }, - plugins: [comlink(), wasm(), solid(), VitePWA(pwaOptions)], + plugins: [ + comlink(), + wasm(), + solid(), + VitePWA(pwaOptions), + sentryVitePlugin({ + org: "sentry", + project: "mutiny-web", + url: "https://sen.mutinywallet.com" + }) + ], worker: { plugins: () => [comlink(), wasm()], format: "es" From 2bbc66701bfad6513c01a1cd0aa8e212f791d918 Mon Sep 17 00:00:00 2001 From: Tony Giorgio Date: Thu, 6 Jun 2024 16:16:26 -0500 Subject: [PATCH 08/11] Ask for diagnostic reporting on startup --- src/routes/setup/Root.tsx | 29 +++++++++++++- src/state/megaStore.tsx | 81 ++++++++++++++++++++++----------------- 2 files changed, 73 insertions(+), 37 deletions(-) diff --git a/src/routes/setup/Root.tsx b/src/routes/setup/Root.tsx index 8e9a79dd0..3b3a9b964 100644 --- a/src/routes/setup/Root.tsx +++ b/src/routes/setup/Root.tsx @@ -1,5 +1,5 @@ import { useNavigate } from "@solidjs/router"; -import { createSignal } from "solid-js"; +import { createEffect, createSignal } from "solid-js"; import logo from "~/assets/mutiny-pixel-logo.png"; import { Button, DefaultMain, NiceP } from "~/components"; @@ -9,8 +9,22 @@ export function Setup() { const [_state, actions] = useMegaStore(); const [isCreatingNewWallet, setIsCreatingNewWallet] = createSignal(false); + const [isDiagnosticReportingEnabled, setIsDiagnosticReportingEnabled] = + createSignal(true); const navigate = useNavigate(); + // default is to set reporting + actions.setReportDiagnostics(); + + // set up a listener that toggles it + createEffect(() => { + if (isDiagnosticReportingEnabled()) { + actions.setReportDiagnostics(); + } else { + actions.disableReportDiagnostics(); + } + }); + async function handleNewWallet() { try { setIsCreatingNewWallet(true); @@ -67,6 +81,19 @@ export function Setup() {
+

+ + setIsDiagnosticReportingEnabled( + !isDiagnosticReportingEnabled() + ) + } + /> + Allow anonymous error reporting to help us improve the app. + You can opt out at any time. +

); diff --git a/src/state/megaStore.tsx b/src/state/megaStore.tsx index c87072454..3974da4a3 100644 --- a/src/state/megaStore.tsx +++ b/src/state/megaStore.tsx @@ -48,41 +48,6 @@ const sentryenv = import.meta.env.VITE_SENTRY_ENVIRONMENT || (DEV ? "dev" : ""); export const makeMegaStoreContext = () => { const [searchParams] = useSearchParams(); const navigate = useNavigate(); - const reportDiagnostics = - localStorage.getItem("report_diagnostics") === "true"; - - // initialize both inside worker and outside - if (reportDiagnostics && sentryenv !== "") { - Sentry.init({ - dsn: "https://192c556849619517322719962a057376@sen.mutinywallet.com/2", - environment: sentryenv, - release: "mutiny-web@" + RELEASE_VERSION, - integrations: [ - Sentry.browserTracingIntegration(), - Sentry.replayIntegration() - ], - - initialScope: { - tags: { component: "main" } - }, - - // Set tracesSampleRate to 1.0 to capture 100% - // of transactions for performance monitoring. - // We recommend adjusting this value in production - tracesSampleRate: 1.0, - - // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled - tracePropagationTargets: [ - "localhost", - /^https:\/\/mutinywallet\.com/ - ], - - // Capture Replay for 10% of all sessions, - // plus 100% of sessions with an error - replaysSessionSampleRate: 0.1, - replaysOnErrorSampleRate: 1.0 - }); - } // Not actually a shared worker, but it's the same code const sw = new ComlinkWorker( @@ -123,7 +88,8 @@ export const makeMegaStoreContext = () => { lang: localStorage.getItem("i18nexLng") || undefined, preferredInvoiceType: "unified" as "unified" | "lightning" | "onchain", should_zap_hodl: localStorage.getItem("should_zap_hodl") === "true", - report_diagnostics: reportDiagnostics, + report_diagnostics: + localStorage.getItem("report_diagnostics") === "true", testflightPromptDismissed: localStorage.getItem("testflightPromptDismissed") === "true", federations: undefined as MutinyFederationIdentity[] | undefined, @@ -208,6 +174,41 @@ export const makeMegaStoreContext = () => { const settings = await getSettings(); setState({ load_stage: "setup" }); + const reportDiagnostics = + localStorage.getItem("report_diagnostics") === "true"; + + if (reportDiagnostics && sentryenv !== "") { + Sentry.init({ + dsn: "https://192c556849619517322719962a057376@sen.mutinywallet.com/2", + environment: sentryenv, + release: "mutiny-web@" + RELEASE_VERSION, + integrations: [ + Sentry.browserTracingIntegration(), + Sentry.replayIntegration() + ], + + initialScope: { + tags: { component: "main" } + }, + + // Set tracesSampleRate to 1.0 to capture 100% + // of transactions for performance monitoring. + // We recommend adjusting this value in production + tracesSampleRate: 1.0, + + // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled + tracePropagationTargets: [ + "localhost", + /^https:\/\/mutinywallet\.com/ + ], + + // Capture Replay for 10% of all sessions, + // plus 100% of sessions with an error + replaysSessionSampleRate: 0.1, + replaysOnErrorSampleRate: 1.0 + }); + } + // handle lsp settings if (searchParams.lsps) { settings.lsp = ""; @@ -559,6 +560,14 @@ export const makeMegaStoreContext = () => { ); setState({ report_diagnostics }); }, + setReportDiagnostics() { + localStorage.setItem("report_diagnostics", "true"); + setState({ report_diagnostics: true }); + }, + disableReportDiagnostics() { + localStorage.setItem("report_diagnostics", "false"); + setState({ report_diagnostics: false }); + }, async refreshFederations() { const federations = await sw.list_federations(); From 2cee96844dbce80bfcc55382fb3969140bf90ca1 Mon Sep 17 00:00:00 2001 From: Tony Giorgio Date: Thu, 6 Jun 2024 17:01:02 -0500 Subject: [PATCH 09/11] Add i18n to initial welcome screen --- public/i18n/en.json | 6 ++++++ src/routes/setup/Root.tsx | 11 ++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/public/i18n/en.json b/public/i18n/en.json index 1f2ba8822..d638fe3a8 100644 --- a/public/i18n/en.json +++ b/public/i18n/en.json @@ -760,6 +760,12 @@ } }, "setup": { + "initial": { + "welcome": "Welcome to the Mutiny!", + "new_wallet": "New Wallet", + "import_existing": "Import Existing", + "reporting": "Allow anonymous error reporting to help us improve the app. You can opt out at any time." + }, "new_profile": { "description": "Mutiny makes payments social.", "title": "Create your profile" diff --git a/src/routes/setup/Root.tsx b/src/routes/setup/Root.tsx index 3b3a9b964..e8becf94f 100644 --- a/src/routes/setup/Root.tsx +++ b/src/routes/setup/Root.tsx @@ -3,10 +3,12 @@ import { createEffect, createSignal } from "solid-js"; import logo from "~/assets/mutiny-pixel-logo.png"; import { Button, DefaultMain, NiceP } from "~/components"; +import { useI18n } from "~/i18n/context"; import { useMegaStore } from "~/state/megaStore"; export function Setup() { const [_state, actions] = useMegaStore(); + const i18n = useI18n(); const [isCreatingNewWallet, setIsCreatingNewWallet] = createSignal(false); const [isDiagnosticReportingEnabled, setIsDiagnosticReportingEnabled] = @@ -62,14 +64,14 @@ export function Setup() { class="h-[50px] w-[172px]" alt="Mutiny Plus logo" /> - Welcome to the Mutiny! + {i18n.t("setup.initial.welcome")}
@@ -91,8 +93,7 @@ export function Setup() { ) } /> - Allow anonymous error reporting to help us improve the app. - You can opt out at any time. + {i18n.t("setup.initial.reporting")}

From 86a367046b6391482e084ee8b478275348d5f403 Mon Sep 17 00:00:00 2001 From: Tony Giorgio Date: Fri, 7 Jun 2024 11:27:13 -0500 Subject: [PATCH 10/11] Remove sentry wasm --- package.json | 1 - pnpm-lock.yaml | 13 ------------- 2 files changed, 14 deletions(-) diff --git a/package.json b/package.json index 73dca5285..eb998fbc4 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,6 @@ "@mutinywallet/mutiny-wasm": "1.7.5", "@sentry/browser": "^8.7.0", "@sentry/vite-plugin": "^2.18.0", - "@sentry/wasm": "^8.7.0", "@solid-primitives/upload": "^0.0.117", "@solidjs/meta": "^0.29.3", "@solidjs/router": "^0.13.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6da9e0dd1..467cda9c6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -62,9 +62,6 @@ dependencies: '@sentry/vite-plugin': specifier: ^2.18.0 version: 2.18.0 - '@sentry/wasm': - specifier: ^8.7.0 - version: 8.7.0 '@solid-primitives/upload': specifier: ^0.0.117 version: 0.0.117(solid-js@1.8.16) @@ -2576,16 +2573,6 @@ packages: - supports-color dev: false - /@sentry/wasm@8.7.0: - resolution: {integrity: sha512-kxzSR/H7A+h8c28gN4vivrukdk6wphf2Oz0MVQd18up1Fbwqmy226hCuAqZgw7aaPI4gfwatEQFm0Higghr9tA==} - engines: {node: '>=14.18'} - dependencies: - '@sentry/browser': 8.7.0 - '@sentry/core': 8.7.0 - '@sentry/types': 8.7.0 - '@sentry/utils': 8.7.0 - dev: false - /@solid-primitives/event-listener@2.3.3(solid-js@1.8.16): resolution: {integrity: sha512-DAJbl+F0wrFW2xmcV8dKMBhk9QLVLuBSW+TR4JmIfTaObxd13PuL7nqaXnaYKDWOYa6otB00qcCUIGbuIhSUgQ==} peerDependencies: From 5ef1f5b531c02fc3560ed1a118cbe15717559a44 Mon Sep 17 00:00:00 2001 From: Paul Miller Date: Fri, 7 Jun 2024 10:21:43 -0500 Subject: [PATCH 11/11] default false diagnostics, style the welcome --- public/i18n/en.json | 2 +- src/routes/setup/Root.tsx | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/public/i18n/en.json b/public/i18n/en.json index d638fe3a8..bc83fd379 100644 --- a/public/i18n/en.json +++ b/public/i18n/en.json @@ -313,7 +313,7 @@ "zaps_to_hodl_enable": "Enable hodl zaps", "zaps_to_hodl_disable": "Disable hodl zaps", "enable_report_diagnostics": "Enable diagnostic reporting?", - "report_diagnostics_desc": "Automatically report critical errors to the developers. All transaction data or other personal information is scrubed and anonymized.", + "report_diagnostics_desc": "Automatically report critical errors to the developers. All transaction data or other personal information is scrubbed and anonymized.", "report_diagnostics_enable": "Enable diagnostics", "report_diagnostics_disable": "Disable diagnostics" } diff --git a/src/routes/setup/Root.tsx b/src/routes/setup/Root.tsx index e8becf94f..660d7f847 100644 --- a/src/routes/setup/Root.tsx +++ b/src/routes/setup/Root.tsx @@ -12,7 +12,7 @@ export function Setup() { const [isCreatingNewWallet, setIsCreatingNewWallet] = createSignal(false); const [isDiagnosticReportingEnabled, setIsDiagnosticReportingEnabled] = - createSignal(true); + createSignal(false); const navigate = useNavigate(); // default is to set reporting @@ -83,9 +83,12 @@ export function Setup() {
-

+

setIsDiagnosticReportingEnabled( @@ -93,8 +96,13 @@ export function Setup() { ) } /> - {i18n.t("setup.initial.reporting")} -

+ +
);