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

🐛[RUMF-559] prevent event without sessionId #425

Merged
merged 2 commits into from
Jun 18, 2020

Conversation

bcaudan
Copy link
Contributor

@bcaudan bcaudan commented Jun 17, 2020

Motivation

Some events are sent to the intake without a session id.

Scenario to reproduce:

  • sdk initialized with a session not tracked on two different tabs
  • session expiration
  • one tab renew the session in a tracked state
  • generate some events on the second tab without interacting with it

then the second tab still considers to be on the last view of the first session, so viewContext.sessionId = undefined.
Events can be added to the batch because session.isTracked() = true due to the value of the cookie.

No matter what is the visibility state of the second tab, we don't want to create a new view and collect the associated events before any real user action on this tab.

Changes

Ensure that viewContext.sessionId is defined to allow events to be added to the batch.


I have gone over the contributing documentation.

@bcaudan bcaudan marked this pull request as ready for review June 17, 2020 17:01
@bcaudan bcaudan requested a review from a team as a code owner June 17, 2020 17:01
Copy link
Contributor

@mquentin mquentin left a comment

Choose a reason for hiding this comment

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

Neat !

@bcaudan bcaudan merged commit 7d4573a into master Jun 18, 2020
@bcaudan bcaudan deleted the bcaudan/undefined-sessionId branch June 18, 2020 08:22
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.

3 participants