File tree Expand file tree Collapse file tree 3 files changed +7
-8
lines changed Expand file tree Collapse file tree 3 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -34,10 +34,9 @@ import {
34
34
import { updateSession } from './session' ;
35
35
36
36
/**
37
- * Absolute maximum number of breadcrumbs added to an event.
38
- * The `maxBreadcrumbs` option cannot be higher than this value.
37
+ * Default value for maximum number of breadcrumbs added to an event.
39
38
*/
40
- const MAX_BREADCRUMBS = 100 ;
39
+ const DEFAULT_MAX_BREADCRUMBS = 100 ;
41
40
42
41
/**
43
42
* Holds additional event information. {@link Scope.applyToEvent} will be
@@ -392,7 +391,7 @@ export class Scope implements ScopeInterface {
392
391
* @inheritDoc
393
392
*/
394
393
public addBreadcrumb ( breadcrumb : Breadcrumb , maxBreadcrumbs ?: number ) : this {
395
- const maxCrumbs = typeof maxBreadcrumbs === 'number' ? Math . min ( maxBreadcrumbs , MAX_BREADCRUMBS ) : MAX_BREADCRUMBS ;
394
+ const maxCrumbs = typeof maxBreadcrumbs === 'number' ? maxBreadcrumbs : DEFAULT_MAX_BREADCRUMBS ;
396
395
397
396
// No data has been changed, so don't notify scope listeners
398
397
if ( maxCrumbs <= 0 ) {
Original file line number Diff line number Diff line change @@ -75,12 +75,12 @@ describe('Scope', () => {
75
75
expect ( ( scope as any ) . _breadcrumbs ) . toHaveLength ( 5 ) ;
76
76
} ) ;
77
77
78
- test ( 'addBreadcrumb cannot go over MAX_BREADCRUMBS value' , ( ) => {
78
+ test ( 'addBreadcrumb can go over DEFAULT_MAX_BREADCRUMBS value' , ( ) => {
79
79
const scope = new Scope ( ) ;
80
- for ( let i = 0 ; i < 111 ; i ++ ) {
80
+ for ( let i = 0 ; i < 120 ; i ++ ) {
81
81
scope . addBreadcrumb ( { message : 'test' } , 111 ) ;
82
82
}
83
- expect ( ( scope as any ) . _breadcrumbs ) . toHaveLength ( 100 ) ;
83
+ expect ( ( scope as any ) . _breadcrumbs ) . toHaveLength ( 111 ) ;
84
84
} ) ;
85
85
86
86
test ( 'setLevel' , ( ) => {
Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ export interface ClientOptions<TO extends BaseTransportOptions = BaseTransportOp
93
93
94
94
/**
95
95
* The maximum number of breadcrumbs sent with events. Defaults to 100.
96
- * Values over 100 will be ignored and 100 used instead .
96
+ * Sentry has a maximum payload size of 1MB and any events exceeding that payload size will be dropped .
97
97
*/
98
98
maxBreadcrumbs ?: number ;
99
99
You can’t perform that action at this time.
0 commit comments