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> {
647
647
*/
648
648
protected _sendEnvelope ( envelope : Envelope ) : PromiseLike < void | TransportMakeRequestResponse > | void {
649
649
if ( this . _transport && this . _dsn ) {
650
+ this . emit ( 'beforeEnvelope' , envelope ) ;
651
+
650
652
return this . _transport . send ( envelope ) . then ( null , reason => {
651
653
__DEBUG_BUILD__ && logger . error ( 'Error while sending event:' , reason ) ;
652
654
} ) ;
Original file line number Diff line number Diff line change @@ -24,8 +24,6 @@ import {
24
24
updateRateLimits ,
25
25
} from '@sentry/utils' ;
26
26
27
- import { getCurrentHub } from '../hub' ;
28
-
29
27
export const DEFAULT_TRANSPORT_BUFFER_SIZE = 30 ;
30
28
31
29
/**
@@ -43,13 +41,9 @@ export function createTransport(
43
41
) : Transport {
44
42
let rateLimits : RateLimits = { } ;
45
43
const flush = ( timeout ?: number ) : PromiseLike < boolean > => buffer . drain ( timeout ) ;
46
- const client = getCurrentHub ( ) . getClient ( ) ;
47
44
48
45
function send ( envelope : Envelope ) : PromiseLike < void | TransportMakeRequestResponse > {
49
46
const filteredEnvelopeItems : EnvelopeItem [ ] = [ ] ;
50
- if ( client && client . emit ) {
51
- client . emit ( 'beforeEnvelope' , envelope ) ;
52
- }
53
47
54
48
// Drop rate limited items from envelope
55
49
forEachEnvelopeItem ( envelope , ( item , type ) => {
You can’t perform that action at this time.
0 commit comments