@@ -11,9 +11,9 @@ import getThreadException from 'sentry/components/events/interfaces/threads/thre
1111import ExternalLink from 'sentry/components/links/externalLink' ;
1212import List from 'sentry/components/list' ;
1313import { JavascriptProcessingErrors } from 'sentry/constants/eventErrors' ;
14- import { t , tct , tn } from 'sentry/locale' ;
14+ import { tct , tn } from 'sentry/locale' ;
1515import { space } from 'sentry/styles/space' ;
16- import { Artifact , Project } from 'sentry/types' ;
16+ import { Project } from 'sentry/types' ;
1717import { DebugFile } from 'sentry/types/debugFiles' ;
1818import { Image } from 'sentry/types/debugImage' ;
1919import { EntryType , Event , ExceptionValue , Thread } from 'sentry/types/event' ;
@@ -25,6 +25,8 @@ import {projectProcessingIssuesMessages} from 'sentry/views/settings/project/pro
2525
2626import { DataSection } from './styles' ;
2727
28+ const ERRORS_TO_HIDE = [ JavascriptProcessingErrors . JS_MISSING_SOURCE ] ;
29+
2830const MAX_ERRORS = 100 ;
2931const MINIFIED_DATA_JAVA_EVENT_REGEX_MATCH =
3032 / ^ ( ( [ \w \$ ] \. [ \w \$ ] { 1 , 2 } ) | ( [ \w \$ ] { 2 } \. [ \w \$ ] \. [ \w \$ ] ) ) ( \. | $ ) / g;
@@ -43,14 +45,6 @@ function isDataMinified(str: string | null) {
4345 return ! ! [ ...str . matchAll ( MINIFIED_DATA_JAVA_EVENT_REGEX_MATCH ) ] . length ;
4446}
4547
46- const getURLPathname = ( url : string ) => {
47- try {
48- return new URL ( url ) . pathname ;
49- } catch {
50- return undefined ;
51- }
52- } ;
53-
5448const hasThreadOrExceptionMinifiedFrameData = (
5549 definedEvent : Event ,
5650 bestThread ?: Thread
@@ -189,28 +183,6 @@ const useFetchProguardMappingFiles = ({
189183 } ;
190184} ;
191185
192- const useFetchReleaseArtifacts = ( { event, project} : { event : Event ; project : Project } ) => {
193- const organization = useOrganization ( ) ;
194- const releaseVersion = event . release ?. version ;
195- const pathNames = ( event . errors ?? [ ] )
196- . filter (
197- error =>
198- error . type === 'js_no_source' && error . data . url && getURLPathname ( error . data . url )
199- )
200- . map ( sourceCodeError => getURLPathname ( sourceCodeError . data . url ) ) ;
201- const { data : releaseArtifacts } = useQuery < Artifact [ ] > (
202- [
203- `/projects/${ organization . slug } /${ project . slug } /releases/${ encodeURIComponent (
204- releaseVersion ?? ''
205- ) } /files/`,
206- { query : { query : pathNames } } ,
207- ] ,
208- { staleTime : Infinity , enabled : pathNames . length > 0 && defined ( releaseVersion ) }
209- ) ;
210-
211- return releaseArtifacts ;
212- } ;
213-
214186const useRecordAnalyticsEvent = ( { event, project} : { event : Event ; project : Project } ) => {
215187 const organization = useOrganization ( ) ;
216188
@@ -239,7 +211,6 @@ const useRecordAnalyticsEvent = ({event, project}: {event: Event; project: Proje
239211export const EventErrors = ( { event, project, isShare} : EventErrorsProps ) => {
240212 const organization = useOrganization ( ) ;
241213 useRecordAnalyticsEvent ( { event, project} ) ;
242- const releaseArtifacts = useFetchReleaseArtifacts ( { event, project} ) ;
243214 const { proguardErrorsLoading, proguardErrors} = useFetchProguardMappingFiles ( {
244215 event,
245216 project,
@@ -272,13 +243,15 @@ export const EventErrors = ({event, project, isShare}: EventErrorsProps) => {
272243 // eslint-disable-next-line react-hooks/exhaustive-deps
273244 } , [ ] ) ;
274245
275- const { dist : eventDistribution , errors : eventErrors = [ ] , _meta} = event ;
246+ const { errors : eventErrors = [ ] , _meta} = event ;
276247
277248 // XXX: uniqWith returns unique errors and is not performant with large datasets
278249 const otherErrors : Array < EventErrorData > =
279250 eventErrors . length > MAX_ERRORS ? eventErrors : uniqWith ( eventErrors , isEqual ) ;
280251
281- const errors = [ ...otherErrors , ...proguardErrors ] ;
252+ const errors = [ ...otherErrors , ...proguardErrors ] . filter (
253+ error => ! ERRORS_TO_HIDE . includes ( error . type as JavascriptProcessingErrors )
254+ ) ;
282255
283256 if ( proguardErrorsLoading ) {
284257 // XXX: This is necessary for acceptance tests to wait until removal since there is
@@ -301,37 +274,6 @@ export const EventErrors = ({event, project, isShare}: EventErrorsProps) => {
301274 { errors . map ( ( error , errorIdx ) => {
302275 const data = error . data ?? { } ;
303276 const meta = _meta ?. errors ?. [ errorIdx ] ;
304-
305- if (
306- error . type === JavascriptProcessingErrors . JS_MISSING_SOURCE &&
307- data . url &&
308- ! ! releaseArtifacts ?. length
309- ) {
310- const releaseArtifact = releaseArtifacts . find ( releaseArt => {
311- const pathname = data . url ? getURLPathname ( data . url ) : undefined ;
312-
313- if ( pathname ) {
314- return releaseArt . name . includes ( pathname ) ;
315- }
316- return false ;
317- } ) ;
318-
319- const releaseArtifactDistribution = releaseArtifact ?. dist ?? null ;
320-
321- // Neither event nor file have dist -> matching
322- // Event has dist, file doesn’t -> not matching
323- // File has dist, event doesn’t -> not matching
324- // Both have dist, same value -> matching
325- // Both have dist, different values -> not matching
326- if ( releaseArtifactDistribution !== eventDistribution ) {
327- error . message = t (
328- 'Source code was not found because the distribution did not match'
329- ) ;
330- data [ 'expected-distribution' ] = eventDistribution ;
331- data [ 'current-distribution' ] = releaseArtifactDistribution ;
332- }
333- }
334-
335277 return < ErrorItem key = { errorIdx } error = { { ...error , data} } meta = { meta } /> ;
336278 } ) }
337279 </ ErrorList >
0 commit comments