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

Android exception aggregate #1999

Draft
wants to merge 45 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
1bb772c
Mark exceptions not handled by user as `handled: false` (#1535)
denrase Jul 27, 2023
3d1d35b
Refrain from overwriting the span status for unfinished spans (#1577)
denrase Aug 22, 2023
380c28a
Merge branch 'main' into release/8.0.0
denrase Aug 29, 2023
852a85e
update changelog
denrase Aug 29, 2023
c59de47
Do not leak extensions of external classes (#1576)
denrase Sep 4, 2023
052a368
Make `hint` non-nullable in `BeforeSendCallback`, `BeforeBreadcrumbCa…
denrase Sep 4, 2023
a37a793
Load Device Contexts from Sentry Java (#1616)
denrase Sep 11, 2023
9b28718
Set ip_address to {{auto}} by default, even if sendDefaultPII is disa…
denrase Oct 9, 2023
d99a1e4
chore: merge main into v8 branch (#1841)
buenaflor Jan 31, 2024
fab52eb
chore(v8): update to min ios version 12 (#1821)
buenaflor Jan 31, 2024
69e55ce
Exception aggregate
ueman Feb 5, 2024
8b62c19
changelog
ueman Feb 5, 2024
c050ff7
Update CHANGELOG.md
ueman Feb 5, 2024
0fb55cf
v8 prep: merge main into 8.0.0 branch (#1871)
buenaflor Feb 7, 2024
5481ba1
Merge branch 'main' into release/8.0.0
buenaflor Feb 8, 2024
9c32a6b
fix json keys in test
ueman Feb 8, 2024
369260a
Merge branch 'release/8.0.0' into exception-aggregates
buenaflor Feb 8, 2024
90c63b9
release: 8.0.0-beta.2
getsentry-bot Feb 8, 2024
89c8e41
Update CHANGELOG
buenaflor Feb 8, 2024
8166d0c
Merge branch 'release/8.0.0-beta.2' into release/8.0.0
Feb 9, 2024
262d775
Merge branch 'release/8.0.0' into exception-aggregates
buenaflor Feb 13, 2024
fafbc8a
Update dart/lib/src/protocol/mechanism.dart
ueman Feb 14, 2024
b7fef82
wip
ueman Feb 8, 2024
6075021
Testflight (#1938)
denrase Apr 10, 2024
94ff648
Merge branch 'main' into release/8.0.0
buenaflor Apr 18, 2024
5539fed
Merge branch 'main' into release/8.0.0
buenaflor Apr 18, 2024
07d34a8
Fix test compilation
buenaflor Apr 18, 2024
4a762db
Update CHANGELOG.md
buenaflor Apr 18, 2024
e74ea75
Update CHANGELOG.md
buenaflor Apr 18, 2024
06368d6
Update CHANGELOG.md
buenaflor Apr 18, 2024
086d66e
Fix analyze issues
buenaflor Apr 18, 2024
621807f
Apply formatter
buenaflor Apr 18, 2024
3af8df8
Update versions to 8.0.0 (#1996)
buenaflor Apr 18, 2024
645aefa
Fix compilation
buenaflor Apr 18, 2024
9acd049
Exception aggregate mechanism (#1866)
ueman Apr 18, 2024
5d2ff07
Update CHANGELOG.md
buenaflor Apr 18, 2024
7689b33
Merge branch 'release/8.0.0' into android-aggregate
ueman Apr 18, 2024
0864a24
Update CHANGELOG.md
ueman Apr 18, 2024
ba67851
Merge branch 'main' into android-aggregate
ueman Apr 19, 2024
77700a3
Merge branch 'main' into android-aggregate
ueman May 19, 2024
c063781
Update CHANGELOG.md
ueman May 19, 2024
8d52dee
Update CHANGELOG.md
ueman May 19, 2024
170b0f1
Update flutter/lib/src/event_processor/android_platform_exception_eve…
ueman May 19, 2024
c490946
please danger
ueman May 19, 2024
610d006
Update CHANGELOG.md
ueman May 19, 2024
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## Unreleased

- Add support for exception aggregates for PlatformExceptions from Android ([#1999](https://github.com/getsentry/sentry-dart/pull/1999))

## 8.2.0

### Enhancements
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,20 @@ class AndroidPlatformExceptionEventProcessor implements EventProcessor {
jvmThreads.add(first);
}

final eventExceptions = event.exceptions?.map((e) {
// TODO: Maybe this shouldn't be applied to all exceptions?
return e.copyWith(
mechanism: Mechanism(
type: 'chained',
exceptionId: jvmExceptions.length,
parentId: 0,
),
);
});

return event.copyWith(
exceptions: [
...?event.exceptions,
...?eventExceptions,
...jvmExceptions,
],
threads: [
Expand Down Expand Up @@ -140,15 +151,18 @@ class _JvmExceptionFactory {
...?jvmException.suppressed,
];

return jvmExceptions.map((exception) {
return exception.toSentryException(nativePackageName);
return jvmExceptions.asMap().entries.map((indexedException) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

return indexedException.value
.toSentryException(nativePackageName, indexedException.key);
}).toList(growable: false);
}
}

extension on JvmException {
MapEntry<SentryException, SentryThread> toSentryException(
String nativePackageName) {
String nativePackageName,
int index,
) {
String? exceptionType;
String? module;
final typeParts = type?.split('.');
Expand All @@ -173,6 +187,12 @@ extension on JvmException {
stackTrace: SentryStackTrace(
frames: stackFrames.reversed.toList(growable: false),
),
mechanism: Mechanism(
type: index == 0 ? "sentry-flutter" : "chained",
exceptionId: index,
parentId: index == 0 ? null : index - 1,
isExceptionGroup: index == 0 ? true : null,
),
);

String threadName;
Expand Down
Loading