Skip to content
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(core): Ensure global event processors are always applied to event #9064

Merged
merged 1 commit into from
Sep 20, 2023

Conversation

mydea
Copy link
Member

@mydea mydea commented Sep 20, 2023

Even if no scope is passed.

I guess this is kind of behavior changing, but I'd argue it is just fixing an unexpected behaviour that's not actually intuitive/logical - that global event processors are only applied if a scope is provided.

I extracted this out from #9032, as I figured this is actually a reasonable change on it's own, so it's easier to reason about this in it's own PR.

@@ -15,7 +15,7 @@ for (const dir of scenariosDirs) {

const processes = scenarios.map(([filename, filepath]) => {
return new Promise(resolve => {
const scenarioProcess = spawn('node', [filepath]);
const scenarioProcess = spawn('node', [filepath], { timeout: 10000 });
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding a timeout so this does not run forever, if a failure happens.

@@ -12,6 +12,9 @@ function cleanUpAndExitSuccessfully() {
}

function assertSessionAggregates(session, expected) {
if (!session.aggregates) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this already failed before, but did not result in test failures because apparently some global event processors were not running and thus no sentry error was produced for this (?)

@github-actions
Copy link
Contributor

size-limit report 📦

Path Size
@sentry/browser (incl. Tracing, Replay) - Webpack (gzipped) 75.6 KB (+0.02% 🔺)
@sentry/browser (incl. Tracing) - Webpack (gzipped) 31.5 KB (+0.03% 🔺)
@sentry/browser - Webpack (gzipped) 22.1 KB (+0.05% 🔺)
@sentry/browser (incl. Tracing, Replay) - ES6 CDN Bundle (gzipped) 70.28 KB (+0.02% 🔺)
@sentry/browser (incl. Tracing) - ES6 CDN Bundle (gzipped) 28.6 KB (+0.04% 🔺)
@sentry/browser - ES6 CDN Bundle (gzipped) 20.67 KB (+0.05% 🔺)
@sentry/browser (incl. Tracing, Replay) - ES6 CDN Bundle (minified & uncompressed) 222.17 KB (+0.01% 🔺)
@sentry/browser (incl. Tracing) - ES6 CDN Bundle (minified & uncompressed) 86.66 KB (+0.03% 🔺)
@sentry/browser - ES6 CDN Bundle (minified & uncompressed) 61.51 KB (+0.04% 🔺)
@sentry/browser (incl. Tracing) - ES5 CDN Bundle (gzipped) 31.48 KB (+0.04% 🔺)
@sentry/react (incl. Tracing, Replay) - Webpack (gzipped) 75.62 KB (+0.02% 🔺)
@sentry/react - Webpack (gzipped) 22.13 KB (+0.05% 🔺)
@sentry/nextjs Client (incl. Tracing, Replay) - Webpack (gzipped) 93.5 KB (+0.02% 🔺)
@sentry/nextjs Client - Webpack (gzipped) 51.08 KB (+0.02% 🔺)

Copy link
Member

@Lms24 Lms24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm generally, I think this is fine and fixes broken behaviour. I'm just wondering when there's actually no scope available... shouldn't there at least be the "base" scope that's created alongside the hub?

@mydea
Copy link
Member Author

mydea commented Sep 20, 2023

Hmm generally, I think this is fine and fixes broken behaviour. I'm just wondering when there's actually no scope available... shouldn't there at least be the "base" scope that's created alongside the hub?

This happens e.g. if you call client.captureException() directly - there, you have to pass the scope as the third argument.
If you use hub.captureException() etc. (or the exported captureException, which calls the hub methods) this is always set by that function. But for more manual usage or similar, it may be unset. So IMHO for average user usage this should not really happen, but it can (theoretically at least).

@mydea mydea merged commit 4583f80 into develop Sep 20, 2023
@mydea mydea deleted the fn/eventProcessor-noScope branch September 20, 2023 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants