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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Unreleased

* Fix: captureTransaction should return emptyId when transaction is discarded (#713)

# 6.3.0-beta.3

* Feat: Auto transactions duration trimming (#702)
Expand Down
2 changes: 1 addition & 1 deletion dart/lib/src/sentry_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ class SentryClient {

final id = await captureEnvelope(
SentryEnvelope.fromTransaction(preparedTransaction, _options.sdk));
return id!;
return id ?? SentryId.empty();
}

/// Reports the [envelope] to Sentry.io.
Expand Down
8 changes: 8 additions & 0 deletions dart/test/sentry_client_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,14 @@ void main() {

expect(capturedEvent['exception'], isNull);
});

test('should return empty for when transaction is discarded', () async {
final client = fixture.getSut(eventProcessor: DropAllEventProcessor());
final tr = SentryTransaction(fixture.tracer);
final id = await client.captureTransaction(tr);

expect(id, SentryId.empty());
});
});

group('SentryClient : apply scope to the captured event', () {
Expand Down