Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

## Unreleased

### Fixes

- Do not set the exception group marker when there is a suppressed exception ([#4056](https://github.com/getsentry/sentry-java/pull/4056))
- Due to how grouping works in Sentry currently sometimes the suppressed exception is treated as the main exception. This change ensures we keep using the main exception and not change how grouping works.
- As a consequence the list of exceptions in the group on top of an issue is no longer shown in Sentry UI.
- We are planning to improve this in the future but opted for this fix first.

### Internal

- Make `SentryClient` constructor public ([#4045](https://github.com/getsentry/sentry-java/pull/4045))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,9 @@ Deque<SentryException> extractExceptionQueueInternal(

Throwable[] suppressed = currentThrowable.getSuppressed();
if (suppressed != null && suppressed.length > 0) {
exceptionMechanism.setExceptionGroup(true);
// Disabled for now as it causes grouping in Sentry to sometimes use
// the suppressed exception as main exception.
// exceptionMechanism.setExceptionGroup(true);
for (Throwable suppressedThrowable : suppressed) {
extractExceptionQueueInternal(
suppressedThrowable, exceptionId, circularityDetector, exceptions);
Expand Down
18 changes: 9 additions & 9 deletions sentry/src/test/java/io/sentry/SentryExceptionFactoryTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ class SentryExceptionFactoryTest {

assertEquals("message", mainInQueue.value)
assertEquals(0, mainInQueue.mechanism?.exceptionId)
assertEquals(true, mainInQueue.mechanism?.isExceptionGroup)
// assertEquals(true, mainInQueue.mechanism?.isExceptionGroup)
}

@Test
Expand All @@ -255,12 +255,12 @@ class SentryExceptionFactoryTest {
assertEquals("inner", mainInQueue.value)
assertEquals(1, mainInQueue.mechanism?.exceptionId)
assertEquals(0, mainInQueue.mechanism?.parentId)
assertEquals(true, mainInQueue.mechanism?.isExceptionGroup)
// assertEquals(true, mainInQueue.mechanism?.isExceptionGroup)

assertEquals("outer", outerInQueue.value)
assertEquals(0, outerInQueue.mechanism?.exceptionId)
assertNull(outerInQueue.mechanism?.parentId)
assertNull(outerInQueue.mechanism?.isExceptionGroup)
// assertNull(outerInQueue.mechanism?.isExceptionGroup)
}

@Test
Expand Down Expand Up @@ -288,12 +288,12 @@ class SentryExceptionFactoryTest {
assertEquals("inner", mainInQueue.value)
assertEquals(1, mainInQueue.mechanism?.exceptionId)
assertEquals(0, mainInQueue.mechanism?.parentId)
assertEquals(true, mainInQueue.mechanism?.isExceptionGroup)
// assertEquals(true, mainInQueue.mechanism?.isExceptionGroup)

assertEquals("outer", outerInQueue.value)
assertEquals(0, outerInQueue.mechanism?.exceptionId)
assertNull(outerInQueue.mechanism?.parentId)
assertNull(outerInQueue.mechanism?.isExceptionGroup)
// assertNull(outerInQueue.mechanism?.isExceptionGroup)
}

@Test
Expand Down Expand Up @@ -324,7 +324,7 @@ class SentryExceptionFactoryTest {
assertEquals("innermost", innerMostExceptionInQueue.value)
assertEquals(3, innerMostExceptionInQueue.mechanism?.exceptionId)
assertEquals(1, innerMostExceptionInQueue.mechanism?.parentId)
assertEquals(true, innerMostExceptionInQueue.mechanism?.isExceptionGroup)
// assertEquals(true, innerMostExceptionInQueue.mechanism?.isExceptionGroup)

assertEquals("suppressed", innerSuppressedInQueue.value)
assertEquals(2, innerSuppressedInQueue.mechanism?.exceptionId)
Expand All @@ -334,7 +334,7 @@ class SentryExceptionFactoryTest {
assertEquals("inner", innerExceptionInQueue.value)
assertEquals(1, innerExceptionInQueue.mechanism?.exceptionId)
assertEquals(0, innerExceptionInQueue.mechanism?.parentId)
assertEquals(true, innerExceptionInQueue.mechanism?.isExceptionGroup)
// assertEquals(true, innerExceptionInQueue.mechanism?.isExceptionGroup)

assertEquals("outer", outerInQueue.value)
assertEquals(0, outerInQueue.mechanism?.exceptionId)
Expand Down Expand Up @@ -378,7 +378,7 @@ class SentryExceptionFactoryTest {
assertEquals("innermost", innerMostExceptionInQueue.value)
assertEquals(3, innerMostExceptionInQueue.mechanism?.exceptionId)
assertEquals(1, innerMostExceptionInQueue.mechanism?.parentId)
assertEquals(true, innerMostExceptionInQueue.mechanism?.isExceptionGroup)
// assertEquals(true, innerMostExceptionInQueue.mechanism?.isExceptionGroup)

assertEquals("suppressed", innerSuppressedInQueue.value)
assertEquals(2, innerSuppressedInQueue.mechanism?.exceptionId)
Expand All @@ -388,7 +388,7 @@ class SentryExceptionFactoryTest {
assertEquals("inner", innerExceptionInQueue.value)
assertEquals(1, innerExceptionInQueue.mechanism?.exceptionId)
assertEquals(0, innerExceptionInQueue.mechanism?.parentId)
assertEquals(true, innerExceptionInQueue.mechanism?.isExceptionGroup)
// assertEquals(true, innerExceptionInQueue.mechanism?.isExceptionGroup)

assertEquals("outer", outerInQueue.value)
assertEquals(0, outerInQueue.mechanism?.exceptionId)
Expand Down
Loading