Uh oh!
There was an error while loading. Please reload this page.
fix(replay): Streamline session creation/refresh - #8813
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
4ef8232 to
0ec5bf6CompareUh oh!
There was an error while loading. Please reload this page.
size-limit report 📦
|
billyvg
left a comment
There was a problem hiding this comment.
LGTM, will do some manual testing tomorrow
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
billyvg
commented
Aug 15, 2023
Hmm do we not use codecov in this repo? |
| // Else, we are not buffering, and the session is expired, so we need to create a new one | ||
| logInfoNextTick('[Replay] Session has expired, creating new one...', traceInternals); | ||
| const newSession = createSession(sessionOptions, { previousSessionId: session.id }); |
Check failure
Code scanning / CodeQL
Insecure randomness
billyvg
commented
Aug 16, 2023
Seeing an issue where we have stale events being flushed alongside the new session, Francesco will be looking into this tomorrow. |
afe8493 to
ebf8ba6Compareebf8ba6 to
6b77c3cComparemydea
commented
Aug 17, 2023
Note: I updated this PR to fix another bug: Now, when we restore a session for sessionStorage, we only start in |
Uh oh!
There was an error while loading. Please reload this page.
We've been using
_loadAndCheckSessionboth in initial session setup as well as when checking for expiration of session.This leads to some not-so-optimized stuff, as we kind of have to do double duty in there (e.g. we constantly re-assign the session etc).
This streamlines this by splitting this into:
_initializeSessionForSampling(): Only called ininitializeSampling()_checkSession(): Called everywhere else, assumes we have a session setup yetOnly the former actually looks into sessionStorage, the latter can assume we always have a session already.
This also extends the behavior so that if we fetch a
buffersession from storage and segment_id > 0, we start the session insessionmode. Without this, we could theoretically run into endless sessions if the user keeps refreshing and keeps having errors, leading to continuous switchovers from buffer>session mode.