Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

- Tag all spans with thread info ([#3101](https://github.com/getsentry/sentry-dart/pull/3101))

### Fixes

- `ThreadInfo` integration should only be added for non-web platforms ([#3144](https://github.com/getsentry/sentry-dart/pull/3144))

## 9.6.0

Note: this release might require updating your Android Gradle Plugin version to at least `8.1.4`.
Expand Down
5 changes: 3 additions & 2 deletions flutter/lib/src/sentry_flutter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,9 @@ mixin SentryFlutter {

integrations.add(DebugPrintIntegration());

integrations.add(ThreadInfoIntegration());

if (!platform.isWeb) {
integrations.add(ThreadInfoIntegration());
}
return integrations;
}

Expand Down
24 changes: 23 additions & 1 deletion flutter/test/sentry_flutter_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import 'package:sentry_flutter/src/integrations/connectivity/connectivity_integr
import 'package:sentry_flutter/src/integrations/integrations.dart';
import 'package:sentry_flutter/src/integrations/screenshot_integration.dart';
import 'package:sentry_flutter/src/integrations/generic_app_start_integration.dart';
import 'package:sentry_flutter/src/integrations/thread_info_integration.dart';
import 'package:sentry_flutter/src/integrations/web_session_integration.dart';
import 'package:sentry_flutter/src/profiling.dart';
import 'package:sentry_flutter/src/renderer/renderer.dart';
Expand Down Expand Up @@ -45,6 +46,7 @@ final linuxWindowsAndWebIntegrations = [

final nonWebIntegrations = [
OnErrorIntegration,
ThreadInfoIntegration,
];

// These should be added to Android
Expand Down Expand Up @@ -719,14 +721,34 @@ void main() {
integration.runtimeType.toString() == 'ThreadInfoIntegration'),
true,
reason:
'ThreadInfoIntegration should be added when tracing is enabled',
'ThreadInfoIntegration should be added on non-web platforms',
);
},
appRunner: appRunner,
options: sentryFlutterOptions,
);
SentryFlutter.native = null;
});

test('ThreadInfoIntegration is not added on web', () async {
final sentryFlutterOptions =
defaultTestOptions(checker: MockRuntimeChecker())
..platform = MockPlatform.linux(isWeb: true)
..methodChannel = native.channel;

await SentryFlutter.init(
(options) {
expect(
options.integrations.any((integration) =>
integration.runtimeType.toString() == 'ThreadInfoIntegration'),
false,
reason: 'ThreadInfoIntegration should not be added on web platform',
);
},
appRunner: appRunner,
options: sentryFlutterOptions,
);
}, testOn: 'browser');
});

test('resumeAppHangTracking calls native method when available', () async {
Expand Down
Loading