Skip to content

Commit

Permalink
Fix: hangs if is empty and SDK NoOp (#920)
Browse files Browse the repository at this point in the history
  • Loading branch information
marandaneto authored Jul 4, 2022
1 parent b38e03b commit 68231be
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 11 deletions.
21 changes: 11 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Unreleased

* Fix: `dio.addSentry` hangs if `dsn` is empty and SDK NoOp ([#920](https://github.com/getsentry/sentry-dart/pull/920))
* Fix: addBreadcrumb throws on Android API < 24 because of NewApi usage ([#923](https://github.com/getsentry/sentry-dart/pull/923))
* [`sentry_dio`](https://pub.dev/packages/sentry_dio) is promoted to GA and not experimental anymore ([#914](https://github.com/getsentry/sentry-dart/pull/914))

Expand All @@ -16,7 +17,7 @@

### Fixes

- Send DidBecomeActiveNotification when OOM enabled (#905)
* Send DidBecomeActiveNotification when OOM enabled (#905)

## 6.6.1

Expand Down Expand Up @@ -72,8 +73,8 @@

## 6.6.0-alpha.2

- Fix serialization of threads (#844)
- Feat: Allow manual init of the Native SDK (#765)
* Fix serialization of threads (#844)
* Feat: Allow manual init of the Native SDK (#765)

## 6.6.0-alpha.1

Expand All @@ -82,23 +83,23 @@

### Sentry Self-hosted Compatibility

- Starting with version `6.6.0` of `sentry`, [Sentry's version >= v21.9.0](https://github.com/getsentry/self-hosted/releases) is required or you have to manually disable sending client reports via the `sendClientReports` option. This only applies to self-hosted Sentry. If you are using [sentry.io](https://sentry.io), no action is needed.
* Starting with version `6.6.0` of `sentry`, [Sentry's version >= v21.9.0](https://github.com/getsentry/self-hosted/releases) is required or you have to manually disable sending client reports via the `sendClientReports` option. This only applies to self-hosted Sentry. If you are using [sentry.io](https://sentry.io), no action is needed.

## 6.5.1

- Update event contexts (#838)
* Update event contexts (#838)

## 6.5.0

- No documented changes.
* No documented changes.

## 6.5.0-beta.2

* Fix: Do not set the transaction to scope if no op (#828)

## 6.5.0-beta.1

- No documented changes.
* No documented changes.

## 6.5.0-alpha.3

Expand All @@ -118,8 +119,8 @@

### Various fixes & improvements

- Fix: Missing userId on iOS when userId is not set (#782) by @marandaneto
- Allow to set startTimestamp & endTimestamp manually to SentrySpan (#676) by @fatihergin
* Fix: Missing userId on iOS when userId is not set (#782) by @marandaneto
* Allow to set startTimestamp & endTimestamp manually to SentrySpan (#676) by @fatihergin

## 6.4.0-beta.3

Expand All @@ -131,7 +132,7 @@

## 6.4.0-beta.2

- No documented changes.
* No documented changes.

## 6.4.0-beta.1

Expand Down
4 changes: 3 additions & 1 deletion dart/lib/src/sentry_options.dart
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,9 @@ class SentryOptions {
}

@internal
SentryOptions.empty();
SentryOptions.empty() {
sdk = SdkVersion(name: 'noop', version: sdkVersion);
}

/// Adds an event processor
void addEventProcessor(EventProcessor eventProcessor) {
Expand Down
13 changes: 13 additions & 0 deletions dart/test/sentry_options_test.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:http/http.dart';
import 'package:meta/meta.dart';
import 'package:sentry/sentry.dart';
import 'package:sentry/src/noop_client.dart';
import 'package:test/test.dart';
Expand Down Expand Up @@ -73,4 +74,16 @@ void main() {

expect(options.isTracingEnabled(), true);
});

test('SentryOptions empty inits the late var', () {
final options = SentryOptions.empty();
options.sdk.addPackage('test', '1.2.3');

expect(
options.sdk.packages
.where((element) =>
element.name == 'test' && element.version == '1.2.3')
.isNotEmpty,
true);
});
}

0 comments on commit 68231be

Please sign in to comment.