File tree 2 files changed +18
-6
lines changed
dev-packages/browser-integration-tests/suites/replay/bufferModeManual
packages/replay-internal/src
2 files changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -350,7 +350,7 @@ sentryTest(
350
350
) ;
351
351
352
352
sentryTest (
353
- '[buffer-mode] manually starting replay includes performance entries with 1s wiggle room ' ,
353
+ '[buffer-mode] manually starting replay ignores earlier performance entries when starting immediately ' ,
354
354
async ( { getLocalTestUrl, page, browserName } ) => {
355
355
// This was sometimes flaky on webkit, so skipping for now
356
356
if ( shouldSkipReplayTest ( ) || browserName === 'webkit' ) {
@@ -388,8 +388,21 @@ sentryTest(
388
388
389
389
const { performanceSpans } = content0 ;
390
390
391
- // web vitals etc. are included with 1s wiggle room, to accomodate "immediate" start
392
- expect ( performanceSpans . length ) . toBeGreaterThan ( 1 ) ;
391
+ expect ( performanceSpans ) . toEqual ( [
392
+ {
393
+ op : 'memory' ,
394
+ description : 'memory' ,
395
+ startTimestamp : expect . any ( Number ) ,
396
+ endTimestamp : expect . any ( Number ) ,
397
+ data : {
398
+ memory : {
399
+ jsHeapSizeLimit : expect . any ( Number ) ,
400
+ totalJSHeapSize : expect . any ( Number ) ,
401
+ usedJSHeapSize : expect . any ( Number ) ,
402
+ } ,
403
+ } ,
404
+ } ,
405
+ ] ) ;
393
406
} ,
394
407
) ;
395
408
Original file line number Diff line number Diff line change @@ -1052,14 +1052,13 @@ export class ReplayContainer implements ReplayContainerInterface {
1052
1052
this . replayPerformanceEntries = [ ] ;
1053
1053
1054
1054
// If we are manually starting, we want to ensure we only include performance entries
1055
- // that are after the initial timestamp, with 1s wiggle room.
1055
+ // that are after the initial timestamp
1056
1056
// The reason for this is that we may have performance entries from the page load, but may decide to start
1057
1057
// the replay later on, in which case we do not want to include these entries.
1058
1058
// without this, manually started replays can have events long before the actual replay recording starts,
1059
1059
// which messes with the timeline etc.
1060
1060
if ( this . _requiresManualStart ) {
1061
- // We leave 1s wiggle room to accomodate timing differences for "immedidate" manual starts
1062
- const initialTimestampInSeconds = this . _context . initialTimestamp / 1000 - 1 ;
1061
+ const initialTimestampInSeconds = this . _context . initialTimestamp / 1000 ;
1063
1062
performanceEntries = performanceEntries . filter ( entry => entry . start >= initialTimestampInSeconds ) ;
1064
1063
}
1065
1064
You can’t perform that action at this time.
0 commit comments