1- import {
2- AggregationCounts ,
3- RequestSessionStatus ,
4- SessionAggregates ,
5- SessionFlusherLike ,
6- Transport ,
7- } from '@sentry/types' ;
1+ import { AggregationCounts , Client , RequestSessionStatus , SessionAggregates , SessionFlusherLike } from '@sentry/types' ;
82import { dropUndefinedKeys , logger } from '@sentry/utils' ;
93
104import { IS_DEBUG_BUILD } from './flags' ;
@@ -24,22 +18,18 @@ export class SessionFlusher implements SessionFlusherLike {
2418 private _sessionAttrs : ReleaseHealthAttributes ;
2519 private _intervalId : ReturnType < typeof setInterval > ;
2620 private _isEnabled : boolean = true ;
27- private _transport : Transport ;
21+ private _client : Client ;
2822
29- public constructor ( transport : Transport , attrs : ReleaseHealthAttributes ) {
30- this . _transport = transport ;
23+ public constructor ( client : Client , attrs : ReleaseHealthAttributes ) {
24+ this . _client = client ;
3125 // Call to setInterval, so that flush is called every 60 seconds
3226 this . _intervalId = setInterval ( ( ) => this . flush ( ) , this . flushTimeout * 1000 ) ;
3327 this . _sessionAttrs = attrs ;
3428 }
3529
3630 /** Sends session aggregates to Transport */
3731 public sendSessionAggregates ( sessionAggregates : SessionAggregates ) : void {
38- if ( ! this . _transport . sendSession ) {
39- IS_DEBUG_BUILD && logger . warn ( "Dropping session because custom transport doesn't implement sendSession" ) ;
40- return ;
41- }
42- void this . _transport . sendSession ( sessionAggregates ) . then ( null , reason => {
32+ void this . _client . sendSession ( sessionAggregates ) . then ( null , reason => {
4333 IS_DEBUG_BUILD && logger . error ( 'Error while sending session:' , reason ) ;
4434 } ) ;
4535 }
0 commit comments