File tree Expand file tree Collapse file tree 9 files changed +100
-13
lines changed
Expand file tree Collapse file tree 9 files changed +100
-13
lines changed Original file line number Diff line number Diff line change 11# Unreleased
22
3+ # 6.0.0-beta.3
4+
5+ * Fix: Re-initialization of Flutter SDK (#526 )
36* Enhancement: Call ` toString() ` on all non-serializable fields (#528 )
47* Fix: Always call ` Flutter.onError ` in order to not swallow messages (#533 )
58* Bump: Android SDK to 5.1.0-beta.6 (#535 )
Original file line number Diff line number Diff line change @@ -10,21 +10,22 @@ import 'sentry_options.dart';
1010import 'throwable_mechanism.dart' ;
1111
1212class IsolateErrorIntegration extends Integration {
13- late RawReceivePort _receivePort;
13+ RawReceivePort ? _receivePort;
1414
1515 @override
1616 FutureOr <void > call (Hub hub, SentryOptions options) async {
17- _receivePort = _createPort (hub, options);
18-
19- Isolate .current.addErrorListener (_receivePort.sendPort);
20-
17+ final safeReceivePort = _receivePort = _createPort (hub, options);
18+ Isolate .current.addErrorListener (safeReceivePort.sendPort);
2119 options.sdk.addIntegration ('isolateErrorIntegration' );
2220 }
2321
2422 @override
2523 void close () {
26- _receivePort.close ();
27- Isolate .current.removeErrorListener (_receivePort.sendPort);
24+ if (_receivePort != null ) {
25+ final safeReceivePort = _receivePort! ;
26+ safeReceivePort.close ();
27+ Isolate .current.removeErrorListener (safeReceivePort.sendPort);
28+ }
2829 }
2930}
3031
Original file line number Diff line number Diff line change 99library version;
1010
1111/// The SDK version reported to Sentry.io in the submitted events.
12- const String sdkVersion = '6.0.0-beta.3 ' ;
12+ const String sdkVersion = '6.0.0-beta.4 ' ;
1313
1414String sdkName (bool isWeb) => isWeb ? _browserSdkName : _ioSdkName;
1515
Original file line number Diff line number Diff line change 11name : sentry
2- version : 6.0.0-beta.3
2+ version : 6.0.0-beta.4
33description : >
44 A crash reporting library for Dart that sends crash reports to Sentry.io.
55 This library supports Dart VM and Web. For Flutter consider sentry_flutter instead.
Original file line number Diff line number Diff line change 1+ @TestOn ('vm' )
2+
3+ import 'package:sentry/sentry.dart' ;
4+ import 'package:test/test.dart' ;
5+
6+ import 'mocks.dart' ;
7+
8+ // Tests for the following issue
9+ // https://github.com/getsentry/sentry-dart/issues/508
10+ // There are no asserts, test are succesfull if no exceptions are thrown.
11+ void main () {
12+ tearDown (() async {
13+ await Sentry .close ();
14+ });
15+
16+ test ('async re-initilization' , () async {
17+ await Sentry .init ((options) {
18+ options.dsn = fakeDsn;
19+ });
20+
21+ await Sentry .close ();
22+
23+ await Sentry .init ((options) {
24+ options.dsn = fakeDsn;
25+ });
26+ });
27+
28+ // This is the failure from
29+ // https://github.com/getsentry/sentry-dart/issues/508
30+ test ('re-initilization' , () {
31+ Sentry .init ((options) {
32+ options.dsn = fakeDsn;
33+ });
34+
35+ Sentry .close ();
36+
37+ Sentry .init ((options) {
38+ options.dsn = fakeDsn;
39+ });
40+ });
41+ }
Original file line number Diff line number Diff line change @@ -225,7 +225,7 @@ class NativeSdkIntegration extends Integration<SentryFlutterOptions> {
225225 NativeSdkIntegration (this ._channel);
226226
227227 final MethodChannel _channel;
228- late SentryFlutterOptions _options;
228+ SentryFlutterOptions ? _options;
229229
230230 @override
231231 FutureOr <void > call (Hub hub, SentryFlutterOptions options) async {
@@ -272,7 +272,7 @@ class NativeSdkIntegration extends Integration<SentryFlutterOptions> {
272272 try {
273273 await _channel.invokeMethod <void >('closeNativeSdk' );
274274 } catch (exception, stackTrace) {
275- _options.logger (
275+ _options? .logger (
276276 SentryLevel .fatal,
277277 'nativeSdkIntegration failed to be closed' ,
278278 exception: exception,
Original file line number Diff line number Diff line change 11/// The SDK version reported to Sentry.io in the submitted events.
2- const String sdkVersion = '6.0.0-beta.3 ' ;
2+ const String sdkVersion = '6.0.0-beta.4 ' ;
33
44/// The default SDK name reported to Sentry.io in the submitted events.
55const String sdkName = 'sentry.dart.flutter' ;
Original file line number Diff line number Diff line change 11name : sentry_flutter
2- version : 6.0.0-beta.3
2+ version : 6.0.0-beta.4
33description : Sentry SDK for Flutter. This package aims to support different Flutter targets by relying on the many platforms supported by Sentry with native SDKs.
44homepage : https://docs.sentry.io/platforms/flutter/
55repository : https://github.com/getsentry/sentry-dart
Original file line number Diff line number Diff line change 1+ @TestOn ('vm' )
2+
3+ import 'package:flutter_test/flutter_test.dart' ;
4+ import 'package:sentry/sentry.dart' ;
5+ import 'package:sentry_flutter/sentry_flutter.dart' ;
6+
7+ import 'mocks.dart' ;
8+
9+ // Tests for the following issue
10+ // https://github.com/getsentry/sentry-dart/issues/508
11+ // There are no asserts, test are succesfull if no exceptions are thrown.
12+ void main () {
13+ tearDown (() async {
14+ await Sentry .close ();
15+ });
16+
17+ test ('async re-initilization' , () async {
18+ await SentryFlutter .init ((options) {
19+ options.dsn = fakeDsn;
20+ });
21+
22+ await Sentry .close ();
23+
24+ await SentryFlutter .init ((options) {
25+ options.dsn = fakeDsn;
26+ });
27+ });
28+
29+ // This is the failure from
30+ // https://github.com/getsentry/sentry-dart/issues/508
31+ test ('re-initilization' , () {
32+ SentryFlutter .init ((options) {
33+ options.dsn = fakeDsn;
34+ });
35+
36+ Sentry .close ();
37+
38+ SentryFlutter .init ((options) {
39+ options.dsn = fakeDsn;
40+ });
41+ });
42+ }
You can’t perform that action at this time.
0 commit comments