Skip to content

Commit 07e2e43

Browse files
authored
feat(replay): Ensure min/max duration when flushing (#8596)
This PR adds a safeguard to ensure we do not flush (=send) a replay that is either too short or too long. We allow to configure a `minReplayDuration`, which defaults to 5s and maxes out at 15s. Whenever we try to flush and the duration is shorter than this, we'll just skip flushing. Additionally, we also skip flushing if the replay is longer than MAX_SESSION_LIFE + 5s (=60min + 5s). This _should not_ happen, technically, but apparently it still does. So while we figure out the root cause of this, we can at least avoid sending stuff in that case.
1 parent 96fdbf4 commit 07e2e43

File tree

54 files changed

+231
-6
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+231
-6
lines changed

packages/browser-integration-tests/scripts/detectFlakyTests.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ import * as path from 'path';
33
import * as childProcess from 'child_process';
44
import { promisify } from 'util';
55

6-
const exec = promisify(childProcess.exec);
7-
86
async function run(): Promise<void> {
97
let testPaths: string[] = [];
108

packages/browser-integration-tests/suites/replay/bufferMode/init.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ window.Sentry = Sentry;
44
window.Replay = new Sentry.Replay({
55
flushMinDelay: 200,
66
flushMaxDelay: 200,
7+
minReplayDuration: 0,
78
});
89

910
Sentry.init({

packages/browser-integration-tests/suites/replay/captureReplayFromReplayPackage/init.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ window.Sentry = Sentry;
55
window.Replay = new Replay({
66
flushMinDelay: 200,
77
flushMaxDelay: 200,
8+
minReplayDuration: 0,
89
});
910

1011
Sentry.init({

packages/browser-integration-tests/suites/replay/compression/init.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ window.Sentry = Sentry;
44
window.Replay = new Sentry.Replay({
55
flushMinDelay: 200,
66
flushMaxDelay: 200,
7+
minReplayDuration: 0,
78
useCompression: true,
89
});
910

packages/browser-integration-tests/suites/replay/customEvents/init.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ window.Sentry = Sentry;
44
window.Replay = new Sentry.Replay({
55
flushMinDelay: 200,
66
flushMaxDelay: 200,
7+
minReplayDuration: 0,
78
useCompression: false,
89
blockAllMedia: false,
910
});

packages/browser-integration-tests/suites/replay/dsc/init.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ window.Sentry = Sentry;
55
window.Replay = new Sentry.Replay({
66
flushMinDelay: 200,
77
flushMaxDelay: 200,
8+
minReplayDuration: 0,
89
useCompression: false,
910
});
1011

packages/browser-integration-tests/suites/replay/errors/droppedError/init.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ window.Sentry = Sentry;
44
window.Replay = new Sentry.Replay({
55
flushMinDelay: 200,
66
flushMaxDelay: 200,
7+
minReplayDuration: 0,
78
});
89

910
Sentry.init({

packages/browser-integration-tests/suites/replay/errors/errorModeCustomTransport/init.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ window.Sentry = Sentry;
44
window.Replay = new Sentry.Replay({
55
flushMinDelay: 200,
66
flushMaxDelay: 200,
7+
minReplayDuration: 0,
78
});
89

910
Sentry.init({

packages/browser-integration-tests/suites/replay/errors/errorNotSent/init.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ window.Sentry = Sentry;
44
window.Replay = new Sentry.Replay({
55
flushMinDelay: 200,
66
flushMaxDelay: 200,
7+
minReplayDuration: 0,
78
});
89

910
Sentry.init({

packages/browser-integration-tests/suites/replay/errors/errorsInSession/init.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ window.Sentry = Sentry;
44
window.Replay = new Sentry.Replay({
55
flushMinDelay: 200,
66
flushMaxDelay: 200,
7+
minReplayDuration: 0,
78
});
89

910
Sentry.init({

0 commit comments

Comments
 (0)