-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(replay): Bump limit for minReplayDuration #18190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+63
−3
Merged
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
010185b
bumpbumpbump
chargome 1113657
Update dev-packages/browser-integration-tests/suites/replay/minReplay…
chargome fb8be13
Update dev-packages/browser-integration-tests/suites/replay/minReplay…
chargome c3fac41
update jsdocs
chargome 793478a
fix lint
chargome bb30696
.
chargome File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
dev-packages/browser-integration-tests/suites/replay/minReplayDurationLimit/init.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| import * as Sentry from '@sentry/browser'; | ||
|
|
||
| window.Sentry = Sentry; | ||
| window.Replay = Sentry.replayIntegration({ | ||
| flushMinDelay: 200, | ||
| flushMaxDelay: 200, | ||
| // Try to set to 60s - should be capped at 50s | ||
| minReplayDuration: 60000, | ||
| }); | ||
|
|
||
| Sentry.init({ | ||
| dsn: 'https://public@dsn.ingest.sentry.io/1337', | ||
| sampleRate: 0, | ||
| replaysSessionSampleRate: 1.0, | ||
| replaysOnErrorSampleRate: 0.0, | ||
|
|
||
| integrations: [window.Replay], | ||
| }); | ||
12 changes: 12 additions & 0 deletions
12
dev-packages/browser-integration-tests/suites/replay/minReplayDurationLimit/template.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| <!doctype html> | ||
| <html> | ||
| <head> | ||
| <meta charset="utf-8" /> | ||
| <title>Replay - minReplayDuration Limit</title> | ||
| </head> | ||
| <body> | ||
| <div id="content"> | ||
| <p>Testing that minReplayDuration is capped at 50s max</p> | ||
| </div> | ||
| </body> | ||
| </html> |
22 changes: 22 additions & 0 deletions
22
dev-packages/browser-integration-tests/suites/replay/minReplayDurationLimit/test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| import { expect } from '@playwright/test'; | ||
| import { sentryTest } from '../../../utils/fixtures'; | ||
| import { shouldSkipReplayTest } from '../../../utils/replayHelpers'; | ||
|
|
||
| sentryTest('caps minReplayDuration to maximum of 50 seconds', async ({ getLocalTestUrl, page }) => { | ||
| if (shouldSkipReplayTest()) { | ||
| sentryTest.skip(); | ||
| } | ||
|
|
||
| const url = await getLocalTestUrl({ testDir: __dirname }); | ||
|
|
||
| await page.goto(url); | ||
|
|
||
| const actualMinReplayDuration = await page.evaluate(() => { | ||
| // @ts-expect-error - Replay is not typed on window | ||
| const replay = window.Replay; | ||
| return replay._initialOptions.minReplayDuration; | ||
| }); | ||
|
|
||
| // Even though we configured it to 60s (60000ms), it should be capped to 50s | ||
| expect(actualMinReplayDuration).toBe(50000); | ||
chargome marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| }); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -45,8 +45,12 @@ export const REPLAY_MAX_EVENT_BUFFER_SIZE = 20_000_000; // ~20MB | |
|
|
||
| /** Replays must be min. 5s long before we send them. */ | ||
| export const MIN_REPLAY_DURATION = 4_999; | ||
| /* The max. allowed value that the minReplayDuration can be set to. */ | ||
| export const MIN_REPLAY_DURATION_LIMIT = 15_000; | ||
|
|
||
| /* | ||
| The max. allowed value that the minReplayDuration can be set to. | ||
| This needs to be below 60s, so we don't unintentionally drop buffered replays that are longer than 60s. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should add the comment in the replay options type so that it's visible to users. We should also be clear that this can drop onError-sampled replays |
||
| */ | ||
| export const MIN_REPLAY_DURATION_LIMIT = 50_000; | ||
|
|
||
| /** The max. length of a replay. */ | ||
| export const MAX_REPLAY_DURATION = 3_600_000; // 60 minutes in ms; | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.