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

Fix: hangs if is empty and SDK NoOp #920

Merged
merged 4 commits into from
Jul 4, 2022
Merged
Show file tree
Hide file tree
Changes from 2 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
22 changes: 12 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Unreleased

* Fix: `dio.addSentry` hangs if `dsn` is empty and SDK NoOp ([#920](https://github.com/getsentry/sentry-dart/pull/920))

### Features

- Bump Android SDK to v6.1.4 ([#900](https://github.com/getsentry/sentry-dart/pull/900))
Expand All @@ -13,7 +15,7 @@

### Fixes

- Send DidBecomeActiveNotification when OOM enabled (#905)
* Send DidBecomeActiveNotification when OOM enabled (#905)
Copy link
Collaborator

Choose a reason for hiding this comment

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

The auto-updater uses -, that should probably be aligned?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Most likely, good catch, auto formatter changed automatically for me.

Copy link
Contributor Author

Choose a reason for hiding this comment

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


## 6.6.1

Expand Down Expand Up @@ -69,8 +71,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 @@ -79,23 +81,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 @@ -115,8 +117,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 @@ -128,7 +130,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);
});
}