Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down Expand Up @@ -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(<ActionableItems {...defaultProps} event={eventWithErrors} />);

expect(
await screen.findByText('Missing Sources Context (1)')
).toBeInTheDocument();
expect(await screen.findByText('Expand')).toBeInTheDocument();
});

it('displays missing mapping file', async () => {
const eventError = [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down