-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
fix(replay): Start replay in afterAllSetup
instead of next tick
#12709
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
Conversation
size-limit report 📦
|
This should hopefully fix some race conditions...
afterAllSetup
instead of next tick
bacf357
to
eeae961
Compare
if (!this._replay) { | ||
return; | ||
} |
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.
Could we remove this now?
@@ -133,8 +134,8 @@ describe('Integration | coreHandlers | handleGlobalEvent', () => { | |||
|
|||
it('tags errors and transactions with replay id for session samples', async () => { | |||
const { replay, integration } = await resetSdkMock({}); | |||
// @ts-expect-error protected but ok to use for testing | |||
integration._initialize(); | |||
integration['_initialize'](getClient()!); |
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.
omg this syntax 😅 Not wrong at all, just JS/TS 🙄 😆
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.
yeah, it is definitely weird, but I prefer this over having to do @ts-expect-error
😅
This should hopefully fix some race conditions.
Instead of initializing replay in the next tick, do it in the current tick but in
afterAllSetup
, to ensure this runs e.g. after the replay-canvas integration.Fixes #12707