File tree Expand file tree Collapse file tree 2 files changed +2
-6
lines changed Expand file tree Collapse file tree 2 files changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -647,6 +647,8 @@ export abstract class BaseClient<O extends ClientOptions> implements Client<O> {
647647 */
648648 protected _sendEnvelope ( envelope : Envelope ) : PromiseLike < void | TransportMakeRequestResponse > | void {
649649 if ( this . _transport && this . _dsn ) {
650+ this . emit ( 'beforeEnvelope' , envelope ) ;
651+
650652 return this . _transport . send ( envelope ) . then ( null , reason => {
651653 __DEBUG_BUILD__ && logger . error ( 'Error while sending event:' , reason ) ;
652654 } ) ;
Original file line number Diff line number Diff line change @@ -24,8 +24,6 @@ import {
2424 updateRateLimits ,
2525} from '@sentry/utils' ;
2626
27- import { getCurrentHub } from '../hub' ;
28-
2927export const DEFAULT_TRANSPORT_BUFFER_SIZE = 30 ;
3028
3129/**
@@ -43,13 +41,9 @@ export function createTransport(
4341) : Transport {
4442 let rateLimits : RateLimits = { } ;
4543 const flush = ( timeout ?: number ) : PromiseLike < boolean > => buffer . drain ( timeout ) ;
46- const client = getCurrentHub ( ) . getClient ( ) ;
4744
4845 function send ( envelope : Envelope ) : PromiseLike < void | TransportMakeRequestResponse > {
4946 const filteredEnvelopeItems : EnvelopeItem [ ] = [ ] ;
50- if ( client && client . emit ) {
51- client . emit ( 'beforeEnvelope' , envelope ) ;
52- }
5347
5448 // Drop rate limited items from envelope
5549 forEachEnvelopeItem ( envelope , ( item , type ) => {
You can’t perform that action at this time.
0 commit comments