From 1e6b3ca35a49b1dcec2f2ae9804026012bedb189 Mon Sep 17 00:00:00 2001 From: Burak Yigit Kaya Date: Wed, 7 Aug 2024 16:19:31 +0100 Subject: [PATCH] revert unrelated change --- .../src/integrations/sentry/sentry-integration.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/overlay/src/integrations/sentry/sentry-integration.ts b/packages/overlay/src/integrations/sentry/sentry-integration.ts index fc0a7463..bd64a21a 100644 --- a/packages/overlay/src/integrations/sentry/sentry-integration.ts +++ b/packages/overlay/src/integrations/sentry/sentry-integration.ts @@ -1,4 +1,4 @@ -import type { Client, Envelope, Event, Integration } from '@sentry/types'; +import { Client, Envelope, Event, Integration } from '@sentry/types'; import { serializeEnvelope } from '@sentry/utils'; import { DEFAULT_SIDECAR_URL } from '~/constants'; import { log } from '../../lib/logger'; @@ -17,8 +17,10 @@ type SpotlightBrowserIntegrationOptions = { /** * A Sentry integration for Spotlight integration that the Overlay will inject automatically. - * This integration does the following: + * This integration does a couple of things: * + * - Try to enrich stack traces by querying a potentially existing context lines integration + * on the server side (@see packages/astro/src/vite/source-context.ts) * - Drop transactions created from interactions with the Spotlight UI * - Forward Sentry events sent from the browser SDK to the Sidecar instance running on * either on http://localhost:8969/stream or on the supplied `sidecarUrl` option. @@ -38,7 +40,7 @@ export const spotlightIntegration = (options?: SpotlightBrowserIntegrationOption setup: () => { log('Using Sidecar URL', _sidecarUrl); }, - processEvent: (event: Event) => { + processEvent: async (event: Event) => { // We don't want to send interaction transactions/root spans created from // clicks within Spotlight to Sentry. Neither do we want them to be sent to // spotlight. @@ -51,6 +53,10 @@ export const spotlightIntegration = (options?: SpotlightBrowserIntegrationOption sentryDataCache.trackLocalTrace(traceId); } + if (event.type || !event.exception || !event.exception.values) { + return event; + } + return event; }, afterAllSetup: (client: Client) => {