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

fix(release-health): Prevent sending terminal status session updates #3701

Merged
merged 11 commits into from
Jun 21, 2021

Conversation

ahmedetefy
Copy link
Contributor

@ahmedetefy ahmedetefy commented Jun 17, 2021

This PR:

  • Drops sending session updates for sessions that are already in terminal states i.e. Crashed, Abnormal, Exited
  • Caps the number of errors for session at 1 regardless of the number of errors a session contains
  • Only sends session updates when session becomes crashed or when there are zero errors and then an error occurs
  • Does not update session's user data after startSession
  • Pulls userAgent on startSession from global object and sets the userAgent attribute

Fixes #3629

@ahmedetefy ahmedetefy requested a review from kamilogorek as a code owner June 17, 2021 19:02
@ahmedetefy ahmedetefy requested a review from AbhiPrasad June 17, 2021 19:03
@github-actions
Copy link
Contributor

github-actions bot commented Jun 17, 2021

size-limit report

Path Size
@sentry/browser - CDN Bundle (gzipped) 21 KB (-0.12% 🔽)
@sentry/browser - Webpack 21.93 KB (+0.07% 🔺)
@sentry/react - Webpack 21.97 KB (+0.07% 🔺)
@sentry/browser + @sentry/tracing - CDN Bundle (gzipped) 28.39 KB (-0.1% 🔽)

Copy link
Member

@AbhiPrasad AbhiPrasad left a comment

Choose a reason for hiding this comment

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

Can simplify the errors calc, and then a comment about including SessionStatus.Exited as a terminal state.

packages/core/src/baseclient.ts Outdated Show resolved Hide resolved
packages/core/src/baseclient.ts Outdated Show resolved Hide resolved
Drops sending session updates for sessions that are already in terminal
states and caps the number of errors for session at 1
@ahmedetefy ahmedetefy force-pushed the ahmed-prevent-send-terminal-updates branch from fe53dd9 to 1534e1e Compare June 18, 2021 06:44
@ahmedetefy ahmedetefy requested a review from AbhiPrasad June 18, 2021 06:49
Comment on lines +29 to +31
function validateSessionCountFunction(sessionCounts) {
process.on('exit', exitCode => {
const { sessionCounter, expectedSessions } = sessionCounts;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
function validateSessionCountFunction(sessionCounts) {
process.on('exit', exitCode => {
const { sessionCounter, expectedSessions } = sessionCounts;
function validateSessionCountFunction({ sessionCounter, expectedSessions }) {
process.on('exit', exitCode => {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Won't work, because this way you are only passing the initial values

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, right. References 🙄

@rhcarvalho

This comment has been minimized.

@ahmedetefy ahmedetefy merged commit 7246a22 into master Jun 21, 2021
@ahmedetefy ahmedetefy deleted the ahmed-prevent-send-terminal-updates branch June 21, 2021 11:15
1999 added a commit to 1999/sentry-javascript that referenced this pull request Jun 25, 2021
…transport

* upstream/master: (29 commits)
  ref: Always use lowercase files (getsentry#3742)
  feat: Make dedupe integration default for browser (getsentry#3730)
  ref(ember): Allow initing Ember without config entry (getsentry#3745)
  fix(serverless): wrapEventFunction does not await for async code (getsentry#3740)
  Metrics: Tag CLS elements (getsentry#3734)
  feat: Add Next.js 11 to supported peer dependencies list (getsentry#3711)
  test: Run integration tests for Next 10/11 and Webpack 4/5 matrix (getsentry#3741)
  fix: Correctly limit Buffer requests (getsentry#3736)
  Whoops. Remove pinned node version from package.json
  ref: Introduce test runner for node session health tests (getsentry#3728)
  fix: Prevent circular structure serialization in events (getsentry#3727)
  ref(node): Update Node manual tests and test for sessionCount (getsentry#3726)
  ref(ember): Update scenarios and remove a few to speed up tests (getsentry#3720)
  docs: Fix typos (getsentry#3716)
  fix(ember): Fix ember test flake (getsentry#3719)
  release: 6.7.2
  ci: fix ember flaky test (getsentry#3718)
  misc: changelog for release 6.7.2 (getsentry#3717)
  fix(release-health): Prevent sending terminal status session updates (getsentry#3701)
  ref: Make beforeSend more strict (getsentry#3713)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Spike in the number of sessions marked as crashed
4 participants