GeezerVison is showing github.com — fix(replay): Start replay in `afterAllSetup` instead of next tick by mydea · Pull Request #12709 · getsentry/sentry-javascript
Conversation
mydea
commented
Jul 1, 2024
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
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
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
size-limit report 📦
| Path |
Size |
| @sentry/browser |
22.22 KB (0%) |
| @sentry/browser (incl. Tracing) |
33.38 KB (0%) |
| @sentry/browser (incl. Tracing, Replay) |
69.12 KB (-0.06% 🔽) |
| @sentry/browser (incl. Tracing, Replay) - with treeshaking flags |
62.45 KB (-0.07% 🔽) |
| @sentry/browser (incl. Tracing, Replay with Canvas) |
73.18 KB (-0.06% 🔽) |
| @sentry/browser (incl. Tracing, Replay, Feedback) |
85.8 KB (-0.03% 🔽) |
| @sentry/browser (incl. Tracing, Replay, Feedback, metrics) |
87.66 KB (-0.03% 🔽) |
| @sentry/browser (incl. metrics) |
26.5 KB (0%) |
| @sentry/browser (incl. Feedback) |
38.86 KB (0%) |
| @sentry/browser (incl. sendFeedback) |
26.84 KB (0%) |
| @sentry/browser (incl. FeedbackAsync) |
31.45 KB (0%) |
| @sentry/react |
24.97 KB (0%) |
| @sentry/react (incl. Tracing) |
36.43 KB (0%) |
| @sentry/vue |
26.33 KB (0%) |
| @sentry/vue (incl. Tracing) |
35.24 KB (0%) |
| @sentry/svelte |
22.36 KB (0%) |
| CDN Bundle |
23.42 KB (0%) |
| CDN Bundle (incl. Tracing) |
35.12 KB (0%) |
| CDN Bundle (incl. Tracing, Replay) |
69.22 KB (-0.05% 🔽) |
| CDN Bundle (incl. Tracing, Replay, Feedback) |
74.41 KB (-0.06% 🔽) |
| CDN Bundle - uncompressed |
68.8 KB (0%) |
| CDN Bundle (incl. Tracing) - uncompressed |
103.82 KB (0%) |
| CDN Bundle (incl. Tracing, Replay) - uncompressed |
214.21 KB (-0.04% 🔽) |
| CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed |
226.92 KB (-0.04% 🔽) |
| @sentry/nextjs (client) |
36.3 KB (0%) |
| @sentry/sveltekit (client) |
34.02 KB (0%) |
| @sentry/node |
130.62 KB (0%) |
| @sentry/node - without tracing |
91.64 KB (-0.01% 🔽) |
| @sentry/aws-serverless |
116.82 KB (+0.01% 🔺) |
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This should hopefully fix some race conditions...
mydea
changed the title
fix(replay): Start replay immediately, not in next tick
fix(replay): Start replay in afterAllSetup instead of next tick
Jul 1, 2024
Comment on lines
296
to
298
|
|
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?
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
const { replay, integration } = await resetSdkMock({});
|
|
|
// @ts-expect-error protected but ok to use for testing
|
|
|
integration._initialize();
|
|
|
integration['_initialize'](getClient()!);
|
s1gr1d
Jul 2, 2024
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this 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.
omg this syntax 😅 Not wrong at all, just JS/TS 🙄 😆
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this 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.
yeah, it is definitely weird, but I prefer this over having to do @ts-expect-error 😅
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Jul 26, 2024
This was referenced Jul 30, 2024
Uh oh!
There was an error while loading. Please reload this page.
Milestone
No milestone
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.
|