diff --git a/static/app/components/events/interfaces/crashContent/exception/actionableItems.spec.tsx b/static/app/components/events/interfaces/crashContent/exception/actionableItems.spec.tsx index 9da0e572b1234c..684a32e5b2c619 100644 --- a/static/app/components/events/interfaces/crashContent/exception/actionableItems.spec.tsx +++ b/static/app/components/events/interfaces/crashContent/exception/actionableItems.spec.tsx @@ -5,6 +5,7 @@ import {ProjectFixture} from 'sentry-fixture/project'; import {render, screen} from 'sentry-test/reactTestingLibrary'; import {ActionableItems} from 'sentry/components/events/interfaces/crashContent/exception/actionableItems'; +import {JavascriptProcessingErrors} from 'sentry/constants/eventErrors'; import {EntryType} from 'sentry/types'; describe('Actionable Items', () => { @@ -115,6 +116,58 @@ describe('Actionable Items', () => { expect(await screen.findByText('Expand')).toBeInTheDocument(); }); + it('does not render hidden flutter web errors', async () => { + const eventErrors = [ + { + type: JavascriptProcessingErrors.JS_MISSING_SOURCES_CONTENT, + data: { + Source: "my_app/main.dart", + }, + }, + { + type: JavascriptProcessingErrors.JS_MISSING_SOURCES_CONTENT, + data: { + Source: "http://localhost:64053/Documents/flutter/packages/flutter/lib/src/material/ink_well.dart", + }, + }, + { + type: JavascriptProcessingErrors.JS_MISSING_SOURCES_CONTENT, + data: { + Source: "org-dartlang-sdk:///dart-sdk/lib/_internal/js_runtime/lib/async_patch.dart", + }, + }, + { + type: JavascriptProcessingErrors.JS_MISSING_SOURCES_CONTENT, + data: { + Source: + "org-dartlang-sdk:///dart-sdk/lib/_internal/js_runtime/lib/js_helper.dart", + }, + }, + ]; + + MockApiClient.addMockResponse({ + url, + body: { + errors: eventErrors, + }, + method: 'GET', + }); + + const eventWithErrors = EventFixture({ + errors: eventErrors, + sdk: { + name: 'sentry.dart.flutter', + }, + }); + + render(); + + expect( + await screen.findByText('Missing Sources Context (1)') + ).toBeInTheDocument(); + expect(await screen.findByText('Expand')).toBeInTheDocument(); + }); + it('displays missing mapping file', async () => { const eventError = [ { diff --git a/static/app/components/events/interfaces/crashContent/exception/actionableItemsUtils.tsx b/static/app/components/events/interfaces/crashContent/exception/actionableItemsUtils.tsx index 936450ea5df235..6c5f35656f328b 100644 --- a/static/app/components/events/interfaces/crashContent/exception/actionableItemsUtils.tsx +++ b/static/app/components/events/interfaces/crashContent/exception/actionableItemsUtils.tsx @@ -128,6 +128,13 @@ export function shouldErrorBeShown(error: EventErrorData, event: Event) { // The Cocoa SDK sends wrong values for contexts.trace.sampled before 8.7.4 return false; } + // Hide unactionable source context errors that happen in flutter web: https://github.com/getsentry/sentry-dart/issues/1764 + if (event.sdk?.name === "sentry.dart.flutter" && error.type === JavascriptProcessingErrors.JS_MISSING_SOURCES_CONTENT) { + const source = error.data?.Source; + if (source.includes("org-dartlang-sdk:///dart-sdk/lib/_internal") || source.includes("flutter/packages/flutter/lib")) { + return false; + } + } return true; }