Skip to content

feat(replay): Do not restart replays on "keydown" #8226

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
merged 3 commits into from
Jun 1, 2023

Conversation

billyvg
Copy link
Member

@billyvg billyvg commented May 26, 2023

This is causing some low-value replays. If you search sentry for replays with duration < 5 seconds, you will see that most of them are re-newed sessions from idle that only have a "keydown" breadcrumb. I suspect users are alt-tabbing out of an idle Sentry page. Removing for now until we have a better way to detect when a session is truly resumed via keydown event.

This is causing some low-value replays. If you search sentry for replays with duration < 5 seconds, you will see that most of them are re-newed sessions from idle that only have a "keydown" breadcrumb. I suspect users are alt-tabbing out of an idle Sentry page. Removing for now until we have a better way to detect when a session is truly resumed via keydown event.
@github-actions
Copy link
Contributor

github-actions bot commented May 26, 2023

size-limit report 📦

Path Size
@sentry/browser - ES5 CDN Bundle (gzipped + minified) 21.05 KB (+0.12% 🔺)
@sentry/browser - ES5 CDN Bundle (minified) 65.69 KB (+0.1% 🔺)
@sentry/browser - ES6 CDN Bundle (gzipped + minified) 19.59 KB (+0.12% 🔺)
@sentry/browser - ES6 CDN Bundle (minified) 58.16 KB (+0.14% 🔺)
@sentry/browser - Webpack (gzipped + minified) 21.21 KB (+0.18% 🔺)
@sentry/browser - Webpack (minified) 69.08 KB (+0.06% 🔺)
@sentry/react - Webpack (gzipped + minified) 21.23 KB (+0.19% 🔺)
@sentry/nextjs Client - Webpack (gzipped + minified) 49.16 KB (+0.1% 🔺)
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) 28.67 KB (+0.11% 🔺)
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified) 26.91 KB (+0.11% 🔺)
@sentry/replay ES6 CDN Bundle (gzipped + minified) 48.5 KB (+1.87% 🔺)
@sentry/replay - Webpack (gzipped + minified) 42.18 KB (+1.75% 🔺)
@sentry/browser + @sentry/tracing + @sentry/replay - ES6 CDN Bundle (gzipped + minified) 67.49 KB (+1.49% 🔺)
@sentry/browser + @sentry/replay - ES6 CDN Bundle (gzipped + minified) 60.38 KB (+1.69% 🔺)

@billyvg billyvg added the Package: replay Issues related to the Sentry Replay SDK label May 29, 2023
@billyvg billyvg requested a review from Lms24 May 29, 2023 15:43
@@ -12,8 +12,9 @@ export function handleKeyboardEvent(replay: ReplayContainer, event: KeyboardEven
return;
}

replay.triggerUserActivity();
Copy link
Member Author

Choose a reason for hiding this comment

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

Alternatively, we could call _updateUserActivity(), the issue with triggerUserActivity is that it will resume recording and create a new session.

cc @mydea

Copy link
Member

Choose a reason for hiding this comment

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

hmm, maybe this... IMHO the "best" solution would be to find the cases where we do not want to capture this (e.g. when tab is involved, ...?) and handle them, but this may be tricky. So probably OK to remove this for now and revisit this later...!

@billyvg billyvg changed the title feat(replay): Do not trigger user activity on "keydown" feat(replay): Do not restart replays on "keydown" May 31, 2023
@billyvg billyvg merged commit 57220f4 into develop Jun 1, 2023
@billyvg billyvg deleted the feat-replay-remove-trigger-user-activity-keydown branch June 1, 2023 13:15
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants