Commit 6de4cba
authored
fix(core): Only consider exception mechanism when updating session status from event with exceptions (#18137)
This PR fixes an oversight in our session update logic when we update
the SDK's session status while processing an error event. Previously,
we'd always set `status: 'crashed'` as soon as the top-level
`event.level` field was set to `'fatal'` (added in
#15072). However,
this disregarded the case where the level was initially `'fatal'` but
later on the SDK or users decided to set the
`event.exceptions.values[i].mechanism.handled` field to `true`.
Simplest reproduction:
```
Sentry.captureException(new Error('test'), { captureContext: { level: 'fatal' } });
```
This PR changes the update logic to only look at the event mechanisms if
the event contained exceptions. I _think_ this is still compatible with
#15072 because the PR suggests we only care about `event.level ===
'fatal'` if no exceptions are on the event. But I'd appreciate a second
pair of eyes on this (cc @timfish).1 parent 8b33254 commit 6de4cba
2 files changed
+107
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1037 | 1037 | | |
1038 | 1038 | | |
1039 | 1039 | | |
| 1040 | + | |
1040 | 1041 | | |
1041 | 1042 | | |
1042 | 1043 | | |
1043 | 1044 | | |
1044 | 1045 | | |
1045 | 1046 | | |
| 1047 | + | |
| 1048 | + | |
1046 | 1049 | | |
1047 | 1050 | | |
1048 | | - | |
1049 | | - | |
| 1051 | + | |
1050 | 1052 | | |
1051 | 1053 | | |
1052 | 1054 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
2308 | 2309 | | |
2309 | 2310 | | |
2310 | 2311 | | |
| 2312 | + | |
| 2313 | + | |
| 2314 | + | |
| 2315 | + | |
| 2316 | + | |
| 2317 | + | |
| 2318 | + | |
| 2319 | + | |
| 2320 | + | |
| 2321 | + | |
| 2322 | + | |
| 2323 | + | |
| 2324 | + | |
| 2325 | + | |
| 2326 | + | |
| 2327 | + | |
| 2328 | + | |
| 2329 | + | |
| 2330 | + | |
| 2331 | + | |
| 2332 | + | |
| 2333 | + | |
| 2334 | + | |
| 2335 | + | |
| 2336 | + | |
| 2337 | + | |
| 2338 | + | |
| 2339 | + | |
| 2340 | + | |
| 2341 | + | |
| 2342 | + | |
| 2343 | + | |
| 2344 | + | |
| 2345 | + | |
| 2346 | + | |
| 2347 | + | |
| 2348 | + | |
| 2349 | + | |
| 2350 | + | |
| 2351 | + | |
| 2352 | + | |
| 2353 | + | |
| 2354 | + | |
| 2355 | + | |
| 2356 | + | |
| 2357 | + | |
| 2358 | + | |
| 2359 | + | |
| 2360 | + | |
| 2361 | + | |
| 2362 | + | |
| 2363 | + | |
| 2364 | + | |
| 2365 | + | |
| 2366 | + | |
| 2367 | + | |
| 2368 | + | |
| 2369 | + | |
| 2370 | + | |
| 2371 | + | |
| 2372 | + | |
| 2373 | + | |
| 2374 | + | |
| 2375 | + | |
| 2376 | + | |
| 2377 | + | |
| 2378 | + | |
| 2379 | + | |
| 2380 | + | |
| 2381 | + | |
| 2382 | + | |
| 2383 | + | |
| 2384 | + | |
| 2385 | + | |
| 2386 | + | |
| 2387 | + | |
| 2388 | + | |
| 2389 | + | |
| 2390 | + | |
| 2391 | + | |
| 2392 | + | |
| 2393 | + | |
| 2394 | + | |
| 2395 | + | |
| 2396 | + | |
| 2397 | + | |
| 2398 | + | |
| 2399 | + | |
| 2400 | + | |
| 2401 | + | |
| 2402 | + | |
| 2403 | + | |
| 2404 | + | |
| 2405 | + | |
| 2406 | + | |
| 2407 | + | |
| 2408 | + | |
| 2409 | + | |
| 2410 | + | |
| 2411 | + | |
| 2412 | + | |
| 2413 | + | |
2311 | 2414 | | |
2312 | 2415 | | |
2313 | 2416 | | |
| |||
0 commit comments