Skip to content
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

ref(replay): Skip events being added too long after initial segment #8768

Merged
merged 1 commit into from
Aug 9, 2023

Conversation

mydea
Copy link
Member

@mydea mydea commented Aug 9, 2023

This ensures we ignore any events being added which are after the session max age.
Maybe this helps with cases where we send weird replays with a single event much after initial timestamp.

I added a test to ensure this does not regress in buffer mode, where recording is continuous and can be "forever".

@mydea mydea added Type: Bug Package: replay Issues related to the Sentry Replay SDK labels Aug 9, 2023
@mydea mydea requested a review from billyvg August 9, 2023 11:37
@mydea mydea self-assigned this Aug 9, 2023
@mydea mydea force-pushed the fn/replay-check-event branch from 9655753 to df247f3 Compare August 9, 2023 11:43
@github-actions
Copy link
Contributor

github-actions bot commented Aug 9, 2023

size-limit report 📦

Path Size
@sentry/browser (incl. Tracing, Replay) - Webpack (gzipped) 75.01 KB (+0.2% 🔺)
@sentry/browser (incl. Tracing) - Webpack (gzipped) 31.11 KB (0%)
@sentry/browser - Webpack (gzipped) 21.81 KB (0%)
@sentry/browser (incl. Tracing, Replay) - ES6 CDN Bundle (gzipped) 69.61 KB (+0.1% 🔺)
@sentry/browser (incl. Tracing) - ES6 CDN Bundle (gzipped) 28.16 KB (+0.04% 🔺)
@sentry/browser - ES6 CDN Bundle (gzipped) 20.18 KB (+0.05% 🔺)
@sentry/browser (incl. Tracing, Replay) - ES6 CDN Bundle (minified & uncompressed) 219.44 KB (+0.18% 🔺)
@sentry/browser (incl. Tracing) - ES6 CDN Bundle (minified & uncompressed) 84.69 KB (+0.03% 🔺)
@sentry/browser - ES6 CDN Bundle (minified & uncompressed) 59.86 KB (+0.04% 🔺)
@sentry/browser (incl. Tracing) - ES5 CDN Bundle (gzipped) 31.03 KB (+0.04% 🔺)
@sentry/react (incl. Tracing, Replay) - Webpack (gzipped) 65.21 KB (+0.24% 🔺)
@sentry/react - Webpack (gzipped) 21.84 KB (0%)
@sentry/nextjs Client (incl. Tracing, Replay) - Webpack (gzipped) 92.84 KB (+0.2% 🔺)
@sentry/nextjs Client - Webpack (gzipped) 50.64 KB (+0.06% 🔺)

@mydea mydea force-pushed the fn/replay-check-event branch from df247f3 to a425cad Compare August 9, 2023 12:31
@@ -39,6 +40,15 @@ export async function addEvent(
return null;
}

// Throw out events that are +60min from the initial timestamp
if (timestampInMs > replay.getContext().initialTimestamp + replay.timeouts.maxSessionLife) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will conflict with #8769

@mydea mydea merged commit bf3eb7f into develop Aug 9, 2023
@mydea mydea deleted the fn/replay-check-event branch August 9, 2023 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: replay Issues related to the Sentry Replay SDK Type: Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants