@@ -45,7 +45,7 @@ type XMLHttpRequestProp = 'onload' | 'onerror' | 'onprogress';
4545
4646/**
4747 * Default Breadcrumbs instrumentations
48- * @deprecated With v6, this will be renamed
48+ * TODO: Deprecated - with v6, this will be renamed to `Instrument`
4949 */
5050export class Breadcrumbs implements Integration {
5151 /**
@@ -255,19 +255,24 @@ export class Breadcrumbs implements Integration {
255255 method : getFetchMethod ( args ) ,
256256 url : getFetchUrl ( args ) ,
257257 } ,
258+ requestComplete : false ,
258259 startTimestamp : Date . now ( ) ,
259260 } ;
260261
262+ triggerHandlers ( handlerData ) ;
263+
261264 return originalFetch . apply ( global , args ) . then (
262265 ( response : Response ) => {
263266 handlerData . endTimestamp = Date . now ( ) ;
267+ handlerData . requestComplete = true ;
264268 handlerData . response = response ;
265269 handlerData . fetchData . status_code = response . status ;
266270 triggerHandlers ( handlerData ) ;
267271 return response ;
268272 } ,
269273 ( error : Error ) => {
270274 handlerData . endTimestamp = Date . now ( ) ;
275+ handlerData . requestComplete = true ;
271276 handlerData . error = error ;
272277 triggerHandlers ( handlerData ) ;
273278 throw error ;
@@ -387,6 +392,7 @@ export class Breadcrumbs implements Integration {
387392 const handlerData : { [ key : string ] : any } = {
388393 args,
389394 endTimestamp : Date . now ( ) ,
395+ requestComplete : false ,
390396 startTimestamp : Date . now ( ) ,
391397 xhr,
392398 } ;
0 commit comments