From 985ac61caa12a0fe530e9b15e4c97bb80ab5d64a Mon Sep 17 00:00:00 2001 From: Denis Andrasec Date: Wed, 6 Aug 2025 11:33:10 +0200 Subject: [PATCH 1/5] =?UTF-8?q?Dont=E2=80=99t=20add=20ThreadInfoIntegratio?= =?UTF-8?q?n=20on=20web=20platforms?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- flutter/lib/src/sentry_flutter.dart | 5 +++-- flutter/test/sentry_flutter_test.dart | 25 ++++++++++++++++++++++++- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/flutter/lib/src/sentry_flutter.dart b/flutter/lib/src/sentry_flutter.dart index f0c39e5d98..03291edf1a 100644 --- a/flutter/lib/src/sentry_flutter.dart +++ b/flutter/lib/src/sentry_flutter.dart @@ -230,8 +230,9 @@ mixin SentryFlutter { integrations.add(DebugPrintIntegration()); - integrations.add(ThreadInfoIntegration()); - + if (!platform.isWeb) { + integrations.add(ThreadInfoIntegration()); + } return integrations; } diff --git a/flutter/test/sentry_flutter_test.dart b/flutter/test/sentry_flutter_test.dart index 17f3c8c1e9..d998c5a7f1 100644 --- a/flutter/test/sentry_flutter_test.dart +++ b/flutter/test/sentry_flutter_test.dart @@ -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'; @@ -45,6 +46,7 @@ final linuxWindowsAndWebIntegrations = [ final nonWebIntegrations = [ OnErrorIntegration, + ThreadInfoIntegration, ]; // These should be added to Android @@ -719,7 +721,7 @@ 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, @@ -727,6 +729,27 @@ void main() { ); 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 { From 0e3ecb4e4d128cd2bdc04b449e8c5d60904b79f7 Mon Sep 17 00:00:00 2001 From: Denis Andrasec Date: Wed, 6 Aug 2025 11:33:17 +0200 Subject: [PATCH 2/5] format --- flutter/test/sentry_flutter_test.dart | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/flutter/test/sentry_flutter_test.dart b/flutter/test/sentry_flutter_test.dart index d998c5a7f1..5da3e3d5cf 100644 --- a/flutter/test/sentry_flutter_test.dart +++ b/flutter/test/sentry_flutter_test.dart @@ -742,8 +742,7 @@ void main() { options.integrations.any((integration) => integration.runtimeType.toString() == 'ThreadInfoIntegration'), false, - reason: - 'ThreadInfoIntegration should not be added on web platform', + reason: 'ThreadInfoIntegration should not be added on web platform', ); }, appRunner: appRunner, From d36e6429582686c599be2aa2daac07bc2ed20834 Mon Sep 17 00:00:00 2001 From: Denis Andrasec Date: Wed, 6 Aug 2025 11:34:45 +0200 Subject: [PATCH 3/5] add cl entry --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ce461cd63..d528354e80 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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`. From 5027c5ed4d91c1b372cb871b798a19b557ba2bdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Andra=C5=A1ec?= Date: Wed, 6 Aug 2025 13:05:24 +0200 Subject: [PATCH 4/5] Update CHANGELOG.md Co-authored-by: Giancarlo Buenaflor --- CHANGELOG.md | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d528354e80..d60fe6e488 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,12 +4,7 @@ ### Features -- 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)) - +- Tag all spans with thread info on non-web platforms ([#3101](https://github.com/getsentry/sentry-dart/pull/3101), [#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`. From 52504c48a45381dc870bae5062b00f94a459b6b7 Mon Sep 17 00:00:00 2001 From: Denis Andrasec Date: Thu, 7 Aug 2025 11:23:42 +0200 Subject: [PATCH 5/5] fix cl --- CHANGELOG.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 03327c43a9..60b7fb7029 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,15 @@ # Changelog -## 9.7.0-beta.1 +## Unreleased ### Features - Tag all spans with thread info on non-web platforms ([#3101](https://github.com/getsentry/sentry-dart/pull/3101), [#3144](https://github.com/getsentry/sentry-dart/pull/3144)) + +## 9.7.0-beta.1 + +### Features + - Tag all spans with thread info ([#3101](https://github.com/getsentry/sentry-dart/pull/3101)) ### Enhancements