@@ -619,22 +619,23 @@ function newEventDispatcher(
619
619
sdkKey : string ,
620
620
config : IClientConfig [ 'eventIngestionConfig' ] = { } ,
621
621
) : EventDispatcher {
622
- const eventQueue = hasWindowLocalStorage ( )
623
- ? new LocalStorageBackedNamedEventQueue < Event > ( 'events' )
624
- : new BoundedEventQueue < Event > ( 'events' ) ;
625
- const emptyNetworkStatusListener =
626
- // eslint-disable-next-line @typescript-eslint/no-empty-function
627
- { isOffline : ( ) => false , onNetworkStatusChange : ( ) => { } } ;
628
- const networkStatusListener =
629
- typeof window !== 'undefined' ? new BrowserNetworkStatusListener ( ) : emptyNetworkStatusListener ;
630
622
// initialize config with default values
631
623
const {
632
624
batchSize = 1_000 ,
633
625
deliveryIntervalMs = 10_000 ,
634
626
retryIntervalMs = 5_000 ,
635
627
maxRetryDelayMs = 30_000 ,
636
628
maxRetries = 3 ,
629
+ maxQueueSize = 10_000 ,
637
630
} = config ;
631
+ const eventQueue = hasWindowLocalStorage ( )
632
+ ? new LocalStorageBackedNamedEventQueue < Event > ( 'events' )
633
+ : new BoundedEventQueue < Event > ( 'events' , [ ] , maxQueueSize ) ;
634
+ const emptyNetworkStatusListener =
635
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
636
+ { isOffline : ( ) => false , onNetworkStatusChange : ( ) => { } } ;
637
+ const networkStatusListener =
638
+ typeof window !== 'undefined' ? new BrowserNetworkStatusListener ( ) : emptyNetworkStatusListener ;
638
639
return newDefaultEventDispatcher ( eventQueue , networkStatusListener , sdkKey , batchSize , {
639
640
deliveryIntervalMs,
640
641
retryIntervalMs,
0 commit comments