fix(replay): Use session.started for min/max duration check#8617
Merged
fix(replay): Use session.started for min/max duration check#8617
session.started for min/max duration check#8617Conversation
Contributor
size-limit report 📦
|
billyvg
approved these changes
Jul 24, 2023
packages/browser-integration-tests/suites/replay/maxReplayDuration/test.ts
Outdated
Show resolved
Hide resolved
Member
There was a problem hiding this comment.
Does this test fail without the new changes?
Member
Author
There was a problem hiding this comment.
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 <billyvg@users.noreply.github.com>
3dde516 to
36807b9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We've been using
context.initialTimestampto 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
startedof 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.startedis 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 😬