Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 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
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
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
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
5264e78
Update CHANGELOG
buenaflor Apr 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
Prev Previous commit
Next Next commit
Exception aggregate mechanism (#1866)
* Exception aggregate

* changelog

* Update CHANGELOG.md

* fix json keys in test

* Update dart/lib/src/protocol/mechanism.dart

* Update CHANGELOG.md

---------

Co-authored-by: Giancarlo Buenaflor <[email protected]>
  • Loading branch information
ueman and buenaflor authored Apr 18, 2024
commit 9acd049cea92d1f097175fe81d74693ec5cccd6b
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
- Set ip_address to {{auto}} by default, even if sendDefaultPII is disabled ([#1665](https://github.com/getsentry/sentry-dart/pull/1665))
- Instead use the "Prevent Storing of IP Addresses" option in the "Security & Privacy" project settings on sentry.io

### Features

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

## 7.20.0

### Build
Expand Down
52 changes: 52 additions & 0 deletions dart/lib/src/protocol/mechanism.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,38 @@ class Mechanism {
/// This may be because they are created at a central place (like a crash handler), and are all called the same: Error, Segfault etc. When the flag is set, Sentry will then try to use other information (top in-app frame function) rather than exception type and value in the UI for the primary event display. This flag should be set for all "segfaults" for instance as every single error group would look very similar otherwise.
final bool? synthetic;

/// An optional boolean value, set `true` when the exception is the exception
/// group type specific to the platform or language.
/// The default is false when omitted.
/// For example, exceptions of type [PlatformException](https://api.flutter.dev/flutter/services/PlatformException-class.html)
/// have set it to `true`, others are set to `false`.
final bool? isExceptionGroup;

/// An optional string value describing the source of the exception.
///
/// The SDK should populate this with the name of the property or attribute of
/// the parent exception that this exception was acquired from.
/// In the case of an array, it should include the zero-based array index as
/// well.
final String? source;

/// An optional numeric value providing an ID for the exception relative to
/// this specific event.
///
/// The SDK should assign simple incrementing integers to each exception in
/// the tree, starting with 0 for the root of the tree.
/// In other words, when flattened into the list provided in the exception
/// values on the event, the last exception in the list should have ID 0,
/// the previous one should have ID 1, the next previous should have ID 2, etc.
final int? exceptionId;

/// An optional numeric value pointing at the [exceptionId] that is the parent
/// of this exception.
///
/// The SDK should assign this to all exceptions except the root exception
/// (the last to be listed in the exception values).
final int? parentId;

Mechanism({
required this.type,
this.description,
Expand All @@ -52,6 +84,10 @@ class Mechanism {
this.synthetic,
Map<String, dynamic>? meta,
Map<String, dynamic>? data,
this.isExceptionGroup,
this.source,
this.exceptionId,
this.parentId,
}) : _meta = meta != null ? Map.from(meta) : null,
_data = data != null ? Map.from(data) : null;

Expand All @@ -63,6 +99,10 @@ class Mechanism {
Map<String, dynamic>? meta,
Map<String, dynamic>? data,
bool? synthetic,
bool? isExceptionGroup,
String? source,
int? exceptionId,
int? parentId,
}) =>
Mechanism(
type: type ?? this.type,
Expand All @@ -72,6 +112,10 @@ class Mechanism {
meta: meta ?? this.meta,
data: data ?? this.data,
synthetic: synthetic ?? this.synthetic,
isExceptionGroup: isExceptionGroup ?? this.isExceptionGroup,
source: source ?? this.source,
exceptionId: exceptionId ?? this.exceptionId,
parentId: parentId ?? this.parentId,
);

/// Deserializes a [Mechanism] from JSON [Map].
Expand All @@ -94,6 +138,10 @@ class Mechanism {
meta: meta,
data: data,
synthetic: json['synthetic'],
isExceptionGroup: json['is_exception_group'],
source: json['source'],
exceptionId: json['exception_id'],
parentId: json['parent_id'],
);
}

Expand All @@ -107,6 +155,10 @@ class Mechanism {
if (_meta?.isNotEmpty ?? false) 'meta': _meta,
if (_data?.isNotEmpty ?? false) 'data': _data,
if (synthetic != null) 'synthetic': synthetic,
if (isExceptionGroup != null) 'is_exception_group': isExceptionGroup,
if (source != null) 'source': source,
if (exceptionId != null) 'exception_id': exceptionId,
if (parentId != null) 'parent_id': parentId,
};
}
}
17 changes: 17 additions & 0 deletions dart/test/protocol/mechanism_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ void main() {
synthetic: true,
meta: {'key': 'value'},
data: {'keyb': 'valueb'},
isExceptionGroup: false,
exceptionId: 0,
parentId: 0,
source: 'source',
);

final mechanismJson = <String, dynamic>{
Expand All @@ -21,6 +25,10 @@ void main() {
'meta': {'key': 'value'},
'data': {'keyb': 'valueb'},
'synthetic': true,
'is_exception_group': false,
'source': 'source',
'exception_id': 0,
'parent_id': 0,
};

group('json', () {
Expand Down Expand Up @@ -51,6 +59,7 @@ void main() {

expect(data.toJson(), copy.toJson());
});

test('copyWith takes new values', () {
final data = mechanism;

Expand All @@ -62,6 +71,10 @@ void main() {
synthetic: false,
meta: {'key1': 'value1'},
data: {'keyb1': 'valueb1'},
exceptionId: 1,
parentId: 1,
isExceptionGroup: false,
source: 'foo',
);

expect('type1', copy.type);
Expand All @@ -71,6 +84,10 @@ void main() {
expect(false, copy.synthetic);
expect({'key1': 'value1'}, copy.meta);
expect({'keyb1': 'valueb1'}, copy.data);
expect(1, copy.exceptionId);
expect(1, copy.parentId);
expect(false, copy.isExceptionGroup);
expect('foo', copy.source);
});
});
}