-
-
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
fix(replay): Use session.started
for min/max duration check
#8617
Conversation
size-limit report 📦
|
packages/browser-integration-tests/suites/replay/maxReplayDuration/test.ts
Outdated
Show resolved
Hide resolved
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.
Does this test fail without the new changes?
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.
No, sadly it does not 😬 I think it is because it still triggers the session refresh, as it should, this is kind of the root cause somewhere that this is under some (?) circumstances not happening. This change should be good/better anyhow, I'd say. And with the improved logging, we maybe get closer to the root of this!
caaaea1
to
3dde516
Compare
…tion/test.ts Co-authored-by: Billy Vong <[email protected]>
3dde516
to
36807b9
Compare
We've been using
context.initialTimestamp
to check for min/max session duration, but actually this is always updated when a tab is refreshed, for example.Instead, we now use
session.started
, which should also always be updated for a buffer session.note that this also means, when an error happens, we flush immediately, but then wait for 5s until we flush again (which is fine, I'd say) - because at the time of conversion of buffer->session, we update the
started
of the session. But that's OK I'd say?I also updated the logging to be based on this. Overall having a log for the buffer->session change makes sense to me anyhow, plus I also added one for the only other case where
session.started
is updated.Note: I added a test to kind of cover this, but this test also passed with the previous version, so 🤷 not entirely sure how to test this better 😬