From 468e428bfc0946f27fcadfff4a48bbc90f349863 Mon Sep 17 00:00:00 2001 From: Joshen Lim Date: Thu, 27 Jun 2024 19:39:39 +0800 Subject: [PATCH] Add some sentry filters (#27588) * Add some sentry filters * Add some sentry filters * Add ? in copyCellValue --- apps/studio/components/grid/components/grid/Grid.tsx | 3 ++- apps/studio/components/grid/utils/common.ts | 2 +- apps/studio/sentry.client.config.ts | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/studio/components/grid/components/grid/Grid.tsx b/apps/studio/components/grid/components/grid/Grid.tsx index dfd01db594a..49472b8ee28 100644 --- a/apps/studio/components/grid/components/grid/Grid.tsx +++ b/apps/studio/components/grid/components/grid/Grid.tsx @@ -102,7 +102,8 @@ export const Grid = memo( const selectedCellRef = useRef<{ rowIdx: number; row: any; column: any } | null>(null) function copyCellValue() { - const selectedCellValue = selectedCellRef.current?.row[selectedCellRef.current?.column?.key] + const selectedCellValue = + selectedCellRef.current?.row?.[selectedCellRef.current?.column?.key] const text = formatClipboardValue(selectedCellValue) if (!text) return copyToClipboard(text) diff --git a/apps/studio/components/grid/utils/common.ts b/apps/studio/components/grid/utils/common.ts index 15b4a5e73fb..ad22480813b 100644 --- a/apps/studio/components/grid/utils/common.ts +++ b/apps/studio/components/grid/utils/common.ts @@ -7,7 +7,7 @@ export function deepClone(obj: unknown) { } export function formatClipboardValue(value: any) { - if (value === null) return '' + if (!value) return '' if (typeof value == 'object' || Array.isArray(value)) { return JSON.stringify(value) } diff --git a/apps/studio/sentry.client.config.ts b/apps/studio/sentry.client.config.ts index a7a1d4be1eb..331dee293b4 100644 --- a/apps/studio/sentry.client.config.ts +++ b/apps/studio/sentry.client.config.ts @@ -42,6 +42,8 @@ Sentry.init({ ignoreErrors: [ // Used exclusively in Monaco Editor. 'ResizeObserver', + 's.getModifierState is not a function', + /^Uncaught NetworkError: Failed to execute 'importScripts' on 'WorkerGlobalScope'/, // [Joshen] We currently use stripe-js for customers to save their credit card data // I'm unable to reproduce this error on local, staging nor prod across chrome, safari or firefox // Based on https://github.com/stripe/stripe-js/issues/26, it seems like this error is safe to ignore,