File tree Expand file tree Collapse file tree 4 files changed +8
-9
lines changed Expand file tree Collapse file tree 4 files changed +8
-9
lines changed Original file line number Diff line number Diff line change 1
1
import type { HandlerDataFetch } from '@sentry/types' ;
2
2
3
3
import type { ReplayContainer , ReplayPerformanceEntry } from '../types' ;
4
- import { addPerformanceEntryBreadcrumb } from './handleNetworkBreadcrumbs' ;
4
+ import { addNetworkBreadcrumb } from './handleNetworkBreadcrumbs' ;
5
5
6
6
/** only exported for tests */
7
7
export function handleFetch ( handlerData : HandlerDataFetch ) : null | ReplayPerformanceEntry {
@@ -38,6 +38,6 @@ export function handleFetchSpanListener(replay: ReplayContainer): (handlerData:
38
38
39
39
const result = handleFetch ( handlerData ) ;
40
40
41
- addPerformanceEntryBreadcrumb ( replay , result ) ;
41
+ addNetworkBreadcrumb ( replay , result ) ;
42
42
} ;
43
43
}
Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ export function handleNetworkBreadcrumb(
84
84
85
85
// Create a replay performance entry from this breadcrumb
86
86
const result = _makeReplayBreadcrumb ( 'resource.xhr' , breadcrumb , hint ) ;
87
- addPerformanceEntryBreadcrumb ( options . replay , result ) ;
87
+ addNetworkBreadcrumb ( options . replay , result ) ;
88
88
}
89
89
90
90
if ( _isFetchBreadcrumb ( breadcrumb ) && _isFetchHint ( hint ) ) {
@@ -93,7 +93,7 @@ export function handleNetworkBreadcrumb(
93
93
94
94
// Create a replay performance entry from this breadcrumb
95
95
const result = _makeReplayBreadcrumb ( 'resource.fetch' , breadcrumb , hint ) ;
96
- addPerformanceEntryBreadcrumb ( options . replay , result ) ;
96
+ addNetworkBreadcrumb ( options . replay , result ) ;
97
97
}
98
98
} catch ( e ) {
99
99
__DEBUG_BUILD__ && logger . warn ( 'Error when enriching network breadcrumb' ) ;
@@ -245,7 +245,7 @@ function getFetchBody(fetchArgs: unknown[] = []): RequestInit['body'] | undefine
245
245
}
246
246
247
247
/** Add a performance entry breadcrumb */
248
- export function addPerformanceEntryBreadcrumb ( replay : ReplayContainer , result : ReplayPerformanceEntry | null ) : void {
248
+ export function addNetworkBreadcrumb ( replay : ReplayContainer , result : ReplayPerformanceEntry | null ) : void {
249
249
if ( ! replay . isEnabled ( ) ) {
250
250
return ;
251
251
}
Original file line number Diff line number Diff line change 1
1
import type { HandlerDataXhr } from '@sentry/types' ;
2
2
3
3
import type { ReplayContainer , ReplayPerformanceEntry } from '../types' ;
4
- import { addPerformanceEntryBreadcrumb } from './handleNetworkBreadcrumbs' ;
4
+ import { addNetworkBreadcrumb } from './handleNetworkBreadcrumbs' ;
5
5
6
6
/** only exported for tests */
7
7
export function handleXhr ( handlerData : HandlerDataXhr ) : ReplayPerformanceEntry | null {
@@ -48,6 +48,6 @@ export function handleXhrSpanListener(replay: ReplayContainer): (handlerData: Ha
48
48
49
49
const result = handleXhr ( handlerData ) ;
50
50
51
- addPerformanceEntryBreadcrumb ( replay , result ) ;
51
+ addNetworkBreadcrumb ( replay , result ) ;
52
52
} ;
53
53
}
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ export function addGlobalListeners(replay: ReplayContainer): void {
23
23
}
24
24
addInstrumentationHandler ( 'dom' , handleDomListener ( replay ) ) ;
25
25
addInstrumentationHandler ( 'history' , handleHistorySpanListener ( replay ) ) ;
26
+ handleNetworkBreadcrumbs ( replay ) ;
26
27
27
28
// If a custom client has no hooks yet, we continue to use the "old" implementation
28
29
const hasHooks = ! ! ( client && client . on ) ;
@@ -35,6 +36,4 @@ export function addGlobalListeners(replay: ReplayContainer): void {
35
36
// eslint-disable-next-line @typescript-eslint/no-explicit-any
36
37
( client as BaseClient < any > ) . on ( 'afterSendEvent' , handleAfterSendEvent ( replay ) ) ;
37
38
}
38
-
39
- handleNetworkBreadcrumbs ( replay ) ;
40
39
}
You can’t perform that action at this time.
0 commit comments