Skip to content

Commit 4583f80

Browse files
authored
fix(core): Ensure global event processors are always applied to event (#9064)
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.
1 parent 469881d commit 4583f80

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

Diff for: packages/core/src/utils/prepareEvent.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { Client, ClientOptions, Event, EventHint, StackFrame, StackParser }
22
import { dateTimestampInSeconds, GLOBAL_OBJ, normalize, resolvedSyncPromise, truncate, uuid4 } from '@sentry/utils';
33

44
import { DEFAULT_ENVIRONMENT } from '../constants';
5-
import { notifyEventProcessors } from '../eventProcessors';
5+
import { getGlobalEventProcessors, notifyEventProcessors } from '../eventProcessors';
66
import { Scope } from '../scope';
77

88
/**
@@ -74,6 +74,9 @@ export function prepareEvent(
7474

7575
// In case we have a hub we reassign it.
7676
result = finalScope.applyToEvent(prepared, hint);
77+
} else {
78+
// Apply global event processors even if there is no scope
79+
result = notifyEventProcessors(getGlobalEventProcessors(), prepared, hint);
7780
}
7881

7982
return result

Diff for: packages/node/test/manual/release-health/runner.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ for (const dir of scenariosDirs) {
1515

1616
const processes = scenarios.map(([filename, filepath]) => {
1717
return new Promise(resolve => {
18-
const scenarioProcess = spawn('node', [filepath]);
18+
const scenarioProcess = spawn('node', [filepath], { timeout: 10000 });
1919
const output = [];
2020
const errors = [];
2121

Diff for: packages/node/test/manual/release-health/session-aggregates/aggregates-disable-single-session.js

+3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ function cleanUpAndExitSuccessfully() {
1212
}
1313

1414
function assertSessionAggregates(session, expected) {
15+
if (!session.aggregates) {
16+
return;
17+
}
1518
// For loop is added here just in the rare occasion that the session count do not land in the same aggregate
1619
// bucket
1720
session.aggregates.forEach(function (_, idx) {

0 commit comments

Comments
 (0)