File tree Expand file tree Collapse file tree 5 files changed +9
-6
lines changed
browser-integration-tests/suites/replay/largeMutations/mutationLimit Expand file tree Collapse file tree 5 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ window.Replay = new Sentry.Replay({
5
5
flushMinDelay : 200 ,
6
6
flushMaxDelay : 200 ,
7
7
_experiments : {
8
- fullSnapshotOnMutationsOver : 250 ,
8
+ mutationLimit : 250 ,
9
9
} ,
10
10
} ) ;
11
11
File renamed without changes.
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import { sentryTest } from '../../../../utils/fixtures';
4
4
import { getReplayRecordingContent , shouldSkipReplayTest , waitForReplayRequest } from '../../../../utils/replayHelpers' ;
5
5
6
6
sentryTest (
7
- 'handles large mutations with _experiments.fullSnapshotOnMutationsOver configured' ,
7
+ 'handles large mutations with _experiments.mutationLimit configured' ,
8
8
async ( { getLocalTestPath, page, forceFlushReplay } ) => {
9
9
if ( shouldSkipReplayTest ( ) ) {
10
10
sentryTest . skip ( ) ;
Original file line number Diff line number Diff line change @@ -828,11 +828,13 @@ export class ReplayContainer implements ReplayContainerInterface {
828
828
private _onMutationHandler = ( mutations : unknown [ ] ) : boolean => {
829
829
const count = mutations . length ;
830
830
831
- const fullSnapshotOnMutationsOver = this . _options . _experiments . fullSnapshotOnMutationsOver || 0 ;
831
+ const mutationLimit = this . _options . _experiments . mutationLimit || 0 ;
832
+ const mutationBreadcrumbLimit = this . _options . _experiments . mutationBreadcrumbLimit || 1000 ;
833
+ const overMutationLimit = mutationLimit && count > mutationLimit ;
832
834
833
835
// Create a breadcrumb if a lot of mutations happen at the same time
834
836
// We can show this in the UI as an information with potential performance improvements
835
- if ( count > 500 || ( fullSnapshotOnMutationsOver && count > fullSnapshotOnMutationsOver ) ) {
837
+ if ( count > mutationBreadcrumbLimit || overMutationLimit ) {
836
838
const breadcrumb = createBreadcrumb ( {
837
839
category : 'replay.mutations' ,
838
840
data : {
@@ -842,7 +844,7 @@ export class ReplayContainer implements ReplayContainerInterface {
842
844
this . _createCustomBreadcrumb ( breadcrumb ) ;
843
845
}
844
846
845
- if ( fullSnapshotOnMutationsOver && count > fullSnapshotOnMutationsOver ) {
847
+ if ( overMutationLimit ) {
846
848
// We want to skip doing an incremental snapshot if there are too many mutations
847
849
// Instead, we do a full snapshot
848
850
this . _triggerFullSnapshot ( false ) ;
Original file line number Diff line number Diff line change @@ -110,7 +110,8 @@ export interface ReplayPluginOptions extends SessionOptions {
110
110
_experiments : Partial < {
111
111
captureExceptions : boolean ;
112
112
traceInternals : boolean ;
113
- fullSnapshotOnMutationsOver : number ;
113
+ mutationLimit : number ;
114
+ mutationBreadcrumbLimit : number ;
114
115
} > ;
115
116
}
116
117
You can’t perform that action at this time.
0 commit comments