-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
feat(browser): Add browserSessionIntegration
#14551
Conversation
❌ 1 Tests Failed:
View the top 1 failed tests by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
size-limit report 📦
|
// concept that can be used as a metric. | ||
// Automatically captured sessions are akin to page views, and thus we | ||
// discard their duration. | ||
startSession({ ignoreDuration: true }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we adjust the startSession
syntax to allow to optionally pass a client directly, and run all of this on setup(client)
instead of setupOnce()
? 🤔
Then again all of this is kind of global, so maybe this does not help anyhow 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had the same thoughts. I am actually extremely unsure on how to proceed. It all depends on how we would want sessions to work. If we want there to be multiple at once, it would make sense, however I would err towards the exact opposite.
I think always only having one session active per page makes the most sense. Even in MFEs. I would even go so far to lock down the API down even more in v9, simply because it makes wrapping your head around the concept easier.
All of this is just thinking out loud though. In general I didn't want this PR to be behaviorally significant. That's why I chose this route.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this makes sense to me!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, let's leave it at one "global" session per page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
@@ -34,7 +34,7 @@ sentryTest('should capture replays (@sentry/browser export)', async ({ getLocalT | |||
event_id: expect.stringMatching(/\w{32}/), | |||
environment: 'production', | |||
sdk: { | |||
integrations: [ | |||
integrations: expect.arrayContaining([ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
l: any reason to loosen the assertions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I personally found it to be very annoying that the ordering needed to be exact. Lmk if you want me to change it back.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah I see, the ordering is annoying, agreed. Though these tests wouldn't fail additionally added integrations, unless I'm completely missing something. So that opens the test up to more behaviour change than previously. I don't think this is the end of the world but it'd be good to have at least one test that fails if we add a new integration by default. We should be aware of stuff like this.
Ref: #14550
Adds a
browserSessionIntegration
that is exported from all browser SDKs which is added whenautoSessionTracking: true
, and entails the exact same functionality asautoSessionTracking
does today.In v9 this integration will become more fleshed out and completely replace
autoSessionTracking
in the browser SDKs.