Browse Source

feat(issue-details): Hide some event errors from issue details (#52908)

this pr hides some event errors from issue details. we determined that
there were many event errors that were unactionable and unhelpful to
show on the issue details page so we are hiding them. later we will
introduce a new widget to replace the current on , so this is a
temporary fix.

Closes https://github.com/getsentry/sentry/issues/52535
Richard Roggenkemper 1 year ago
parent
commit
27b80934d0

+ 17 - 1
static/app/components/events/eventErrors.spec.tsx

@@ -2,7 +2,10 @@ import {render, screen, userEvent, within} from 'sentry-test/reactTestingLibrary
 import {textWithMarkupMatcher} from 'sentry-test/utils';
 
 import {EventErrors} from 'sentry/components/events/eventErrors';
-import {JavascriptProcessingErrors} from 'sentry/constants/eventErrors';
+import {
+  GenericSchemaErrors,
+  JavascriptProcessingErrors,
+} from 'sentry/constants/eventErrors';
 import {EntryType} from 'sentry/types';
 
 describe('EventErrors', () => {
@@ -101,6 +104,19 @@ describe('EventErrors', () => {
     expect(screen.queryByText(/problem processing this event/i)).not.toBeInTheDocument();
   });
 
+  it('hides event error that is hidden', () => {
+    const eventWithUnknownError = TestStubs.Event({
+      errors: [
+        {
+          type: GenericSchemaErrors.UNKNOWN_ERROR,
+        },
+      ],
+    });
+
+    render(<EventErrors {...defaultProps} event={eventWithUnknownError} />);
+    expect(screen.queryByText(/problem processing this event/i)).not.toBeInTheDocument();
+  });
+
   describe('proguard errors', () => {
     beforeEach(() => {
       MockApiClient.addMockResponse({

+ 26 - 2
static/app/components/events/eventErrors.tsx

@@ -12,7 +12,9 @@ import ExternalLink from 'sentry/components/links/externalLink';
 import List from 'sentry/components/list';
 import {
   CocoaProcessingErrors,
+  GenericSchemaErrors,
   JavascriptProcessingErrors,
+  NativeProcessingErrors,
 } from 'sentry/constants/eventErrors';
 import {tct, tn} from 'sentry/locale';
 import {space} from 'sentry/styles/space';
@@ -29,7 +31,22 @@ import {projectProcessingIssuesMessages} from 'sentry/views/settings/project/pro
 
 import {DataSection} from './styles';
 
-const ERRORS_TO_HIDE = [JavascriptProcessingErrors.JS_MISSING_SOURCE];
+const ERRORS_TO_HIDE = [
+  JavascriptProcessingErrors.JS_MISSING_SOURCE,
+  JavascriptProcessingErrors.JS_INVALID_SOURCEMAP,
+  JavascriptProcessingErrors.JS_INVALID_SOURCEMAP_LOCATION,
+  JavascriptProcessingErrors.JS_TOO_MANY_REMOTE_SOURCES,
+  JavascriptProcessingErrors.JS_INVALID_SOURCE_ENCODING,
+  GenericSchemaErrors.UNKNOWN_ERROR,
+  GenericSchemaErrors.MISSING_ATTRIBUTE,
+  NativeProcessingErrors.NATIVE_NO_CRASHED_THREAD,
+  NativeProcessingErrors.NATIVE_INTERNAL_FAILURE,
+  NativeProcessingErrors.NATIVE_MISSING_SYSTEM_DSYM,
+  NativeProcessingErrors.NATIVE_MISSING_SYMBOL,
+  NativeProcessingErrors.NATIVE_SIMULATOR_FRAME,
+  NativeProcessingErrors.NATIVE_UNKNOWN_IMAGE,
+  NativeProcessingErrors.NATIVE_SYMBOLICATOR_FAILED,
+];
 
 const MAX_ERRORS = 100;
 const MINIFIED_DATA_JAVA_EVENT_REGEX_MATCH =
@@ -50,7 +67,14 @@ function isDataMinified(str: string | null) {
 }
 
 function shouldErrorBeShown(error: EventErrorData, event: Event) {
-  if (ERRORS_TO_HIDE.includes(error.type as JavascriptProcessingErrors)) {
+  if (
+    ERRORS_TO_HIDE.includes(
+      error.type as
+        | JavascriptProcessingErrors
+        | GenericSchemaErrors
+        | NativeProcessingErrors
+    )
+  ) {
     return false;
   }
   if (

+ 41 - 0
static/app/constants/eventErrors.tsx

@@ -12,6 +12,47 @@ export enum JavascriptProcessingErrors {
   JS_FETCH_TIMEOUT = 'js_fetch_timeout',
 }
 
+export enum HttpProcessingErrors {
+  SECURITY_VIOLATION = 'security_violation',
+  RESTRICTED_IP = 'restricted_ip',
+  FETCH_GENERIC_ERROR = 'fetch_generic_error',
+  FETCH_INVALID_HTTP_CODE = 'fetch_invalid_http_code',
+  FETCH_INVALID_ENCODING = 'fetch_invalid_source_encoding',
+  FETCH_TOO_LARGE = 'fetch_too_large',
+  FETCH_TIMEOUT = 'fetch_timeout',
+  TOO_LARGE_FOR_CACHE = 'too_large_for_cache',
+}
+
+export enum GenericSchemaErrors {
+  UNKNOWN_ERROR = 'unknown_error',
+  INVALID_DATA = 'invalid_data',
+  INVALID_ATTRIBUTE = 'invalid_attribute',
+  MISSING_ATTRIBUTE = 'missing_attribute',
+  VALUE_TOO_LONG = 'value_too_long',
+  FUTURE_TIMESTAMP = 'future_timestamp',
+  PAST_TIMESTAMP = 'past_timestamp',
+  CLOCK_DRIFT = 'clock_drift',
+  INVALID_ENVIRONMENT = 'invalid_environment',
+}
+
+export enum NativeProcessingErrors {
+  NATIVE_NO_CRASHED_THREAD = 'native_no_crashed_thread',
+  NATIVE_INTERNAL_FAILURE = 'native_internal_failure',
+  NATIVE_BAD_DSYM = 'native_bad_dsym',
+  NATIVE_MISSING_OPTIONALLY_BUNDLED_DSYM = 'native_optionally_bundled_dsym',
+  NATIVE_MISSING_DSYM = 'native_missing_dsym',
+  NATIVE_MISSING_SYSTEM_DSYM = 'native_missing_system_dsym',
+  NATIVE_MISSING_SYMBOL = 'native_missing_symbol',
+  NATIVE_SIMULATOR_FRAME = 'native_simulator_frame',
+  NATIVE_UNKNOWN_IMAGE = 'native_unknown_image',
+  NATIVE_SYMBOLICATOR_FAILED = 'native_symbolicator_failed',
+}
+
+export enum ProguardProcessingErrors {
+  PROGUARD_MISSING_MAPPING = 'proguard_missing_mapping',
+  PROGUARD_MISSING_LINENO = 'proguard_missing_lineno',
+}
+
 export enum CocoaProcessingErrors {
   COCOA_INVALID_DATA = 'invalid_data',
 }