Skip to content

Commit 7404fdc

Browse files
authored
fix(core): fatal events should set session as crashed (#15072)
In the Electron SDK, we have to manually set sessions as crashed when native crashes are encountered: https://github.com/getsentry/sentry-electron/blob/dabd6daf0c19c2a6f224d1e721eb5d58c3cf61ac/src/main/integrations/sentry-minidump/index.ts#L175 This has the downside that if you return `null` in `beforeSend`, the event still impacts the release health crash rate. I found that this was required because `_updateSessionFromEvent` in `@sentry/core` does not consider the Electron native events as a crash or an error because there are no exceptions in the event. This PR ensures that any event with a `fatal` level is considered a crash.
1 parent 62fdfe7 commit 7404fdc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/core/src/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -758,7 +758,7 @@ export abstract class Client<O extends ClientOptions = ClientOptions> {
758758

759759
/** Updates existing session based on the provided event */
760760
protected _updateSessionFromEvent(session: Session, event: Event): void {
761-
let crashed = false;
761+
let crashed = event.level === 'fatal';
762762
let errored = false;
763763
const exceptions = event.exception?.values;
764764

0 commit comments

Comments
 (0)