Skip to content
Draft
Show file tree
Hide file tree
Changes from all 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
32 changes: 32 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,37 @@
# Changelog

## 9.20.0

### Features

- (span-first) Add transaction and app start type span attributes by @buenaflor in [#3678](https://github.com/getsentry/sentry-dart/pull/3678)
- Prevent cross-organization trace continuation by @antonis in [#3567](https://github.com/getsentry/sentry-dart/pull/3567)
- By default, the SDK now extracts the organization ID from the DSN (e.g. `o123.ingest.sentry.io`) and compares it with the `sentry-org_id` value in incoming baggage headers. When the two differ, the SDK starts a fresh trace instead of continuing the foreign one. This guards against accidentally linking traces across organizations.
- New option `strictTraceContinuation` (default `false`): when enabled, both the SDK's org ID **and** the incoming baggage org ID must be present and match for a trace to be continued. Traces with a missing org ID on either side are rejected.
- New option `orgId`: allows explicitly setting the organization ID for self-hosted and Relay setups where it cannot be extracted from the DSN.
- Options are also applied to the native Android SDK. On iOS, only the Dart layer enforces strict trace continuation.

### Fixes

#### Flutter

- Avoid JNI callbacks for Android scope sync by @denrase in [#3676](https://github.com/getsentry/sentry-dart/pull/3676)
- Send frame delay in seconds by @buenaflor in [#3677](https://github.com/getsentry/sentry-dart/pull/3677)

### Dependencies

#### Deps

- chore(deps): update Android SDK to v8.41.0 by @github-actions in [#3687](https://github.com/getsentry/sentry-dart/pull/3687)
- chore(deps): update Cocoa SDK to v8.58.2 by @github-actions in [#3664](https://github.com/getsentry/sentry-dart/pull/3664)
- chore(deps): update Native SDK to v0.13.8 by @github-actions in [#3667](https://github.com/getsentry/sentry-dart/pull/3667)

### Internal Changes

- Remove collection runtime dependency by @buenaflor in [#3680](https://github.com/getsentry/sentry-dart/pull/3680)
- Notify linked issues on release by @buenaflor in [#3685](https://github.com/getsentry/sentry-dart/pull/3685)
- Enforce conventional commit format for PR titles by @buenaflor in [#3666](https://github.com/getsentry/sentry-dart/pull/3666)

## 9.19.0

### Features
Expand Down
1 change: 1 addition & 0 deletions docs/sdk-versions.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ This document shows which version of the various Sentry SDKs are used in which S

| Sentry Flutter SDK | Sentry Android SDK | Sentry Cocoa SDK | Sentry JavaScript SDK | Sentry Native SDK |
| ------------------ | ------------------ | ---------------- | --------------------- | ----------------- |
| 9.20.0 | 8.41.0 | 8.58.2 | 10.38.0 | 0.13.8 |
| 9.19.0 | 8.39.1 | 8.58.1 | 10.38.0 | 0.13.7 |
| 9.18.0 | 8.38.0 | 8.58.1 | 10.38.0 | 0.13.7 |
| 9.17.0 | 8.38.0 | 8.58.1 | 10.38.0 | 0.13.6 |
Expand Down
2 changes: 1 addition & 1 deletion packages/dart/lib/src/version.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
library;

/// The SDK version reported to Sentry.io in the submitted events.
const String sdkVersion = '9.19.0';
const String sdkVersion = '9.20.0';

String sdkName(bool isWeb) => isWeb ? _browserSdkName : _ioSdkName;

Expand Down
2 changes: 1 addition & 1 deletion packages/dart/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: sentry
version: 9.19.0
version: 9.20.0
description: >
A crash reporting library for Dart that sends crash reports to Sentry.io.
This library supports Dart VM and Web. For Flutter consider sentry_flutter instead.
Expand Down
2 changes: 1 addition & 1 deletion packages/dio/lib/src/version.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/// The SDK version reported to Sentry.io in the submitted events.
const String sdkVersion = '9.19.0';
const String sdkVersion = '9.20.0';

/// The package name reported to Sentry.io in the submitted events.
const String packageName = 'pub:sentry_dio';
4 changes: 2 additions & 2 deletions packages/dio/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: sentry_dio
description: An integration which adds support for performance tracing for the Dio package.
version: 9.19.0
version: 9.20.0
homepage: https://docs.sentry.io/platforms/dart/
repository: https://github.com/getsentry/sentry-dart
issue_tracker: https://github.com/getsentry/sentry-dart/issues
Expand All @@ -19,7 +19,7 @@ platforms:

dependencies:
dio: ^5.2.0
sentry: 9.19.0
sentry: 9.20.0

dev_dependencies:
_sentry_testing:
Expand Down
2 changes: 1 addition & 1 deletion packages/drift/lib/src/version.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/// The SDK version reported to Sentry.io in the submitted events.
const String sdkVersion = '9.19.0';
const String sdkVersion = '9.20.0';

/// The package name reported to Sentry.io in the submitted events.
const String packageName = 'pub:sentry_drift';
4 changes: 2 additions & 2 deletions packages/drift/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: sentry_drift
description: An integration which adds support for performance tracing for the drift package.
version: 9.19.0
version: 9.20.0
homepage: https://docs.sentry.io/platforms/flutter/
repository: https://github.com/getsentry/sentry-dart
issue_tracker: https://github.com/getsentry/sentry-dart/issues
Expand All @@ -17,7 +17,7 @@ platforms:
web:

dependencies:
sentry: 9.19.0
sentry: 9.20.0
meta: ^1.3.0
drift: ^2.24.0

Expand Down
2 changes: 1 addition & 1 deletion packages/file/lib/src/version.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/// The SDK version reported to Sentry.io in the submitted events.
const String sdkVersion = '9.19.0';
const String sdkVersion = '9.20.0';

/// The package name reported to Sentry.io in the submitted events.
const String packageName = 'pub:sentry_file';
4 changes: 2 additions & 2 deletions packages/file/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: sentry_file
description: An integration which adds support for performance tracing for dart.io.File.
version: 9.19.0
version: 9.20.0
homepage: https://docs.sentry.io/platforms/dart/
repository: https://github.com/getsentry/sentry-dart
issue_tracker: https://github.com/getsentry/sentry-dart/issues
Expand All @@ -17,7 +17,7 @@ platforms:
windows:

dependencies:
sentry: 9.19.0
sentry: 9.20.0
meta: ^1.3.0

dev_dependencies:
Expand Down
4 changes: 2 additions & 2 deletions packages/firebase_remote_config/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: sentry_firebase_remote_config
description: "Sentry integration to use feature flags from Firebase Remote Config."
version: 9.19.0
version: 9.20.0
homepage: https://docs.sentry.io/platforms/flutter/
repository: https://github.com/getsentry/sentry-dart
issue_tracker: https://github.com/getsentry/sentry-dart/issues
Expand All @@ -21,7 +21,7 @@ dependencies:
flutter:
sdk: flutter
firebase_remote_config: '>=5.4.3 <7.0.0'
sentry: 9.19.0
sentry: 9.20.0

dev_dependencies:
flutter_test:
Expand Down
107 changes: 53 additions & 54 deletions packages/flutter/example/integration_test/integration_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import 'package:flutter/widgets.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:http/http.dart';
import 'package:integration_test/integration_test.dart';
import 'package:jni/jni.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:sentry_flutter/sentry_flutter.dart';
import 'package:sentry_flutter_example/main.dart';
Expand Down Expand Up @@ -221,57 +222,56 @@ void main() {
});
});

final ref = jni.ScopesAdapter.getInstance()?.getOptions().reference;
expect(ref, isNotNull);
final androidOptions = jni.SentryAndroidOptions.fromReference(ref!);
final scopesAdapter = jni.ScopesAdapter.instance;
expect(scopesAdapter, isNotNull);
final androidOptions =
scopesAdapter!.options.as(jni.SentryAndroidOptions.type);

expect(androidOptions, isNotNull);
expect(androidOptions.getDsn()?.toDartString(), fakeDsn);
expect(androidOptions.isDebug(), isTrue);
final diagnostic = androidOptions.getDiagnosticLevel();
expect(androidOptions.dsn?.toDartString(), fakeDsn);
expect(androidOptions.isDebug, isTrue);
final diagnostic = androidOptions.diagnosticLevel;
expect(
diagnostic,
jni.SentryLevel.ERROR,
);
expect(androidOptions.getEnvironment()?.toDartString(), 'init-test-env');
expect(androidOptions.getRelease()?.toDartString(), '1.2.3+9');
expect(androidOptions.getDist()?.toDartString(), '42');
expect(androidOptions.isSendDefaultPii(), isTrue);
expect(androidOptions.isAttachStacktrace(), isFalse);
expect(androidOptions.isAttachThreads(), isTrue);
expect(androidOptions.getMaxBreadcrumbs(), 7);
expect(androidOptions.getMaxCacheItems(), 77);
expect(androidOptions.getMaxAttachmentSize(), 512);
expect(androidOptions.isEnableScopeSync(), isTrue);
expect(androidOptions.isAnrEnabled(), isFalse);
expect(androidOptions.getAnrTimeoutIntervalMillis(), 2000);
expect(androidOptions.isEnableActivityLifecycleBreadcrumbs(), isFalse);
expect(androidOptions.isEnableAppLifecycleBreadcrumbs(), isFalse);
expect(androidOptions.isEnableSystemEventBreadcrumbs(), isFalse);
expect(androidOptions.isEnableAppComponentBreadcrumbs(), isFalse);
expect(androidOptions.isEnableUserInteractionBreadcrumbs(), isFalse);
expect(androidOptions.getConnectionTimeoutMillis(), 1234);
expect(androidOptions.getReadTimeoutMillis(), 2345);
expect(androidOptions.isEnableSpotlight(), isTrue);
expect(androidOptions.isSendClientReports(), isFalse);
expect(androidOptions.environment?.toDartString(), 'init-test-env');
expect(androidOptions.release$1?.toDartString(), '1.2.3+9');
expect(androidOptions.dist?.toDartString(), '42');
expect(androidOptions.isSendDefaultPii, isTrue);
expect(androidOptions.isAttachStacktrace, isFalse);
expect(androidOptions.isAttachThreads, isTrue);
expect(androidOptions.maxBreadcrumbs, 7);
expect(androidOptions.maxCacheItems, 77);
expect(androidOptions.maxAttachmentSize, 512);
expect(androidOptions.isEnableScopeSync, isTrue);
expect(androidOptions.isAnrEnabled, isFalse);
expect(androidOptions.anrTimeoutIntervalMillis, 2000);
expect(androidOptions.isEnableActivityLifecycleBreadcrumbs, isFalse);
expect(androidOptions.isEnableAppLifecycleBreadcrumbs, isFalse);
expect(androidOptions.isEnableSystemEventBreadcrumbs, isFalse);
expect(androidOptions.isEnableAppComponentBreadcrumbs, isFalse);
expect(androidOptions.isEnableUserInteractionBreadcrumbs, isFalse);
expect(androidOptions.connectionTimeoutMillis, 1234);
expect(androidOptions.readTimeoutMillis, 2345);
expect(androidOptions.isEnableSpotlight, isTrue);
expect(androidOptions.isSendClientReports, isFalse);
expect(
androidOptions.getSpotlightConnectionUrl()?.toDartString(),
androidOptions.spotlightConnectionUrl?.toDartString(),
Sentry.currentHub.options.spotlight.url,
);
expect(androidOptions.getSentryClientName()?.toDartString(),
expect(androidOptions.sentryClientName?.toDartString(),
'$androidSdkName/${jni.BuildConfig.VERSION_NAME?.toDartString()}');
expect(androidOptions.getNativeSdkName()?.toDartString(), nativeSdkName);
expect(androidOptions.getSdkVersion()?.getName().toDartString(),
androidSdkName);
expect(androidOptions.getSdkVersion()?.getVersion().toDartString(),
expect(androidOptions.nativeSdkName?.toDartString(), nativeSdkName);
expect(androidOptions.sdkVersion?.name.toDartString(), androidSdkName);
expect(androidOptions.sdkVersion?.version.toDartString(),
jni.BuildConfig.VERSION_NAME?.toDartString());
final allPackages = androidOptions
.getSdkVersion()
?.getPackageSet()
final allPackages = androidOptions.sdkVersion?.packageSet
.asDart()
.map((pkg) {
if (pkg == null) return null;
return SentryPackage(
pkg.getName().toDartString(), pkg.getVersion().toDartString());
pkg.name.toDartString(), pkg.version.toDartString());
})
.nonNulls
.toList();
Expand All @@ -280,21 +280,21 @@ void main() {
(p) => p.name == package.name && p.version == package.version);
expect(findMatchingPackage, isNotNull);
}
expect(androidOptions.isEnableAutoTraceIdGeneration(), isFalse);
expect(androidOptions.isTombstoneEnabled(), isTrue);
expect(androidOptions.isEnableAutoTraceIdGeneration, isFalse);
expect(androidOptions.isTombstoneEnabled, isTrue);

final androidProxy = androidOptions.getProxy();
final androidProxy = androidOptions.proxy;
expect(androidProxy, isNotNull);
expect(androidProxy!.getHost()?.toDartString(), 'proxy.local');
expect(androidProxy.getPort()?.toDartString(), '8084');
expect(androidProxy.getUser()?.toDartString(), 'u');
expect(androidProxy.getPass()?.toDartString(), 'p');

final r = androidOptions.getSessionReplay();
expect(r.getQuality(), jni.SentryReplayOptions$SentryReplayQuality.HIGH);
expect(r.getSessionSampleRate(), isNotNull);
expect(r.getOnErrorSampleRate(), isNotNull);
expect(r.isTrackConfiguration(), isFalse);
expect(androidProxy!.host?.toDartString(), 'proxy.local');
expect(androidProxy.port?.toDartString(), '8084');
expect(androidProxy.user?.toDartString(), 'u');
expect(androidProxy.pass?.toDartString(), 'p');

final r = androidOptions.sessionReplay;
expect(r.quality, jni.SentryReplayOptions$SentryReplayQuality.HIGH);
expect(r.sessionSampleRate, isNotNull);
expect(r.onErrorSampleRate, isNotNull);
expect(r.isTrackConfiguration, isFalse);
}, skip: !Platform.isAndroid);

testWidgets('loads native contexts through loadContexts', (tester) async {
Expand Down Expand Up @@ -1079,10 +1079,10 @@ void main() {
final dartTraceId =
Sentry.currentHub.scope.propagationContext.traceId.toString();

final traceParent = jni.Sentry.getTraceparent();
final traceParent = jni.Sentry.traceparent;
expect(traceParent, isNotNull,
reason: 'Native traceparent should not be null');
final traceHeader = traceParent!.getValue().toDartString();
final traceHeader = traceParent!.value.toDartString();

final nativeTraceId = traceHeader.split('-').first;
expect(nativeTraceId, dartTraceId,
Expand All @@ -1095,8 +1095,7 @@ void main() {
// Allow the fire-and-forget dispatch to complete
await Future<void>.delayed(const Duration(milliseconds: 100));

final newTraceParent =
jni.Sentry.getTraceparent()?.getValue().toDartString();
final newTraceParent = jni.Sentry.traceparent?.value.toDartString();
final newTraceHeader = newTraceParent!.toString();

final newNativeTraceId = newTraceHeader.split('-').first;
Expand Down
Loading