Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Merge branch 'main' into umbrella/melos
  • Loading branch information
buenaflor committed Aug 6, 2025
commit 9da64c1c488746460d96102600c99d251912f663
2 changes: 1 addition & 1 deletion .github/workflows/update-deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Update Dependencies
on:
# Run every day.
schedule:
- cron: '0 3 * * *'
- cron: "0 3 * * *"
# And on on every PR merge so we get the updated dependencies ASAP, and to make sure the changelog doesn't conflict.
push:
branches:
Expand Down
37 changes: 37 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,42 @@
# Changelog

## Unreleased

### Features

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

## 9.6.0

Note: this release might require updating your Android Gradle Plugin version to at least `8.1.4`.

### Fixes

- False replay config restarts because of `ScreenshotWidgetStatus` equality issues ([#3114](https://github.com/getsentry/sentry-dart/pull/3114))
- Debug meta not loaded for split debug info only builds ([#3104](https://github.com/getsentry/sentry-dart/pull/3104))
- TTID/TTFD root transactions ([#3099](https://github.com/getsentry/sentry-dart/pull/3099), [#3111](https://github.com/getsentry/sentry-dart/pull/3111))
- Web, Linux and Windows now create a UI transaction for the root page
- iOS, Android now correctly create idle transactions
- Fixes behaviour of traceId generation and TTFD for app start
- Directionality assertion issue in debug mode ([#3088](https://github.com/getsentry/sentry-dart/pull/3088))

### Dependencies

- Bump JNI from v0.14.1 to v0.14.2 ([#3075](https://github.com/getsentry/sentry-dart/pull/3075))
- Bump Android SDK from v8.13.2 to v8.17.0 ([#2977](https://github.com/getsentry/sentry-dart/pull/2977))
- [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#8170)
- [diff](https://github.com/getsentry/sentry-java/compare/8.13.2...8.17.0)

### Internal

- Use lifecycle hook for before send event ([#3017](https://github.com/getsentry/sentry-dart/pull/3017))

## 9.6.0-beta.2

### Fixes

- False replay config restarts because of `ScreenshotWidgetStatus` equality issues ([#3114](https://github.com/getsentry/sentry-dart/pull/3114))

## 9.6.0-beta.1

### Fixes
Expand Down
16 changes: 0 additions & 16 deletions packages/dart/lib/src/hub.dart
Original file line number Diff line number Diff line change
Expand Up @@ -650,22 +650,6 @@ class Hub {

SentryProfilerFactory? _profilerFactory;

@internal
Map<Type, List<Function>> get lifecycleCallbacks =>
_peek().client.lifeCycleRegistry.lifecycleCallbacks;

@internal
void registerSdkLifecycleCallback<T extends SdkLifecycleEvent>(
SdkLifecycleCallback<T> callback) {
_peek().client.lifeCycleRegistry.registerCallback<T>(callback);
}

@internal
void removeSdkLifecycleCallback<T extends SdkLifecycleEvent>(
SdkLifecycleCallback<T> callback) {
_peek().client.lifeCycleRegistry.removeCallback<T>(callback);
}

SentryEvent _assignTraceContext(SentryEvent event) {
// assign trace context
if (event.throwable != null && event.contexts.trace == null) {
Expand Down
17 changes: 0 additions & 17 deletions packages/dart/lib/src/hub_adapter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import 'profiling.dart';
import 'protocol.dart';
import 'protocol/sentry_feedback.dart';
import 'scope.dart';
import 'sdk_lifecycle_hooks.dart';
import 'sentry.dart';
import 'sentry_client.dart';
import 'sentry_options.dart';
Expand Down Expand Up @@ -200,20 +199,4 @@ class HubAdapter implements Hub {

@override
FutureOr<void> captureLog(SentryLog log) => Sentry.currentHub.captureLog(log);

@override
Map<Type, List<Function>> get lifecycleCallbacks =>
Sentry.currentHub.lifecycleCallbacks;

@override
void registerSdkLifecycleCallback<T extends SdkLifecycleEvent>(
SdkLifecycleCallback<T> callback) {
Sentry.currentHub.registerSdkLifecycleCallback(callback);
}

@override
void removeSdkLifecycleCallback<T extends SdkLifecycleEvent>(
SdkLifecycleCallback<T> callback) {
Sentry.currentHub.removeSdkLifecycleCallback(callback);
}
}
2 changes: 1 addition & 1 deletion packages/dart/lib/src/logs_enricher_integration.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class LogsEnricherIntegration extends Integration<SentryOptions> {
@override
FutureOr<void> call(Hub hub, SentryOptions options) {
if (options.enableLogs) {
hub.registerSdkLifecycleCallback<OnBeforeCaptureLog>(
options.lifecycleRegistry.registerCallback<OnBeforeCaptureLog>(
(event) async {
final os = getSentryOperatingSystem();

Expand Down
12 changes: 0 additions & 12 deletions packages/dart/lib/src/noop_hub.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import 'profiling.dart';
import 'protocol.dart';
import 'protocol/sentry_feedback.dart';
import 'scope.dart';
import 'sdk_lifecycle_hooks.dart';
import 'sentry_client.dart';
import 'sentry_options.dart';
import 'tracing.dart';
Expand Down Expand Up @@ -145,15 +144,4 @@ class NoOpHub implements Hub {

@override
Scope get scope => Scope(_options);

@override
Map<Type, List<Function>> get lifecycleCallbacks => {};

@override
void registerSdkLifecycleCallback<T extends SdkLifecycleEvent>(
SdkLifecycleCallback<T> callback) {}

@override
void removeSdkLifecycleCallback<T extends SdkLifecycleEvent>(
SdkLifecycleCallback<T> callback) {}
}
7 changes: 0 additions & 7 deletions packages/dart/lib/src/noop_sentry_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ import 'hint.dart';
import 'protocol.dart';
import 'protocol/sentry_feedback.dart';
import 'scope.dart';
import 'sdk_lifecycle_hooks.dart';
import 'sentry_client.dart';
import 'sentry_envelope.dart';
import 'sentry_options.dart';
import 'sentry_trace_context_header.dart';

class NoOpSentryClient implements SentryClient {
Expand Down Expand Up @@ -71,9 +69,4 @@ class NoOpSentryClient implements SentryClient {

@override
FutureOr<void> captureLog(SentryLog log, {Scope? scope}) async {}

final _lifeCycleRegistry = SdkLifecycleRegistry(SentryOptions.empty());

@override
SdkLifecycleRegistry get lifeCycleRegistry => _lifeCycleRegistry;
}
8 changes: 8 additions & 0 deletions packages/dart/lib/src/sdk_lifecycle_hooks.dart
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,11 @@ class OnBeforeSendEvent extends SdkLifecycleEvent {
final SentryEvent event;
final Hint hint;
}

/// Dispatched when a sampled span is started.
@internal
class OnSpanStart extends SdkLifecycleEvent {
OnSpanStart(this.span);

final ISentrySpan span;
}
14 changes: 3 additions & 11 deletions packages/dart/lib/src/sentry_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,6 @@ class SentryClient {

static final _emptySentryId = Future.value(SentryId.empty());

late final SdkLifecycleRegistry _lifecycleRegistry;

/// Allows registration and dispatching of callbacks outside of SentryClient
@internal
SdkLifecycleRegistry get lifeCycleRegistry => _lifecycleRegistry;

SentryExceptionFactory get _exceptionFactory => _options.exceptionFactory;
SentryStackTraceFactory get _stackTraceFactory => _options.stackTraceFactory;

Expand Down Expand Up @@ -89,9 +83,7 @@ class SentryClient {

/// Instantiates a client using [SentryOptions]
SentryClient._(this._options)
: _random = _options.sampleRate == null ? null : Random() {
_lifecycleRegistry = SdkLifecycleRegistry(_options);
}
: _random = _options.sampleRate == null ? null : Random();

/// Reports an [event] to Sentry.io.
Future<SentryId> captureEvent(
Expand Down Expand Up @@ -172,7 +164,7 @@ class SentryClient {
}

// Event is fully processed and ready to be sent
await _lifecycleRegistry
await _options.lifecycleRegistry
.dispatchCallback(OnBeforeSendEvent(preparedEvent, hint));

var attachments = List<SentryAttachment>.from(scope?.attachments ?? []);
Expand Down Expand Up @@ -579,7 +571,7 @@ class SentryClient {
}

if (processedLog != null) {
await _lifecycleRegistry
await _options.lifecycleRegistry
.dispatchCallback(OnBeforeCaptureLog(processedLog));
_options.logBatcher.addLog(processedLog);
} else {
Expand Down
3 changes: 3 additions & 0 deletions packages/dart/lib/src/sentry_options.dart
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,9 @@ class SentryOptions {
@internal
late ClientReportRecorder recorder = NoOpClientReportRecorder();

@internal
late SdkLifecycleRegistry lifecycleRegistry = SdkLifecycleRegistry(this);

/// List of strings/regex controlling to which outgoing requests
/// the SDK will attach tracing headers.
///
Expand Down
6 changes: 6 additions & 0 deletions packages/dart/lib/src/sentry_tracer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ class SentryTracer extends ISentrySpan {
collector.onSpanStarted(_rootSpan);
}
}
_dispatchOnSpanStart(_rootSpan);
}

@override
Expand Down Expand Up @@ -271,6 +272,7 @@ class SentryTracer extends ISentrySpan {
collector.onSpanStarted(child);
}
}
_dispatchOnSpanStart(child);

return child;
}
Expand Down Expand Up @@ -435,4 +437,8 @@ class SentryTracer extends ISentrySpan {
});
}
}

void _dispatchOnSpanStart(ISentrySpan span) {
_hub.options.lifecycleRegistry.dispatchCallback(OnSpanStart(span));
}
}
5 changes: 5 additions & 0 deletions packages/dart/lib/src/span_data_convention.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,10 @@ class SpanDataConvention {
static const frozenFrames = 'frames.frozen';
static const framesDelay = 'frames.delay';

// Thread/Isolate data keys according to Sentry span data conventions
// https://develop.sentry.dev/sdk/telemetry/traces/span-data-conventions/#thread
static const threadId = 'thread.id';
static const threadName = 'thread.name';

// TODO: eventually add other data keys here as well
}
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.6.0-beta.1';
const String sdkVersion = '9.6.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.6.0-beta.1
version: 9.6.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
6 changes: 4 additions & 2 deletions packages/dart/test/sentry_client_lifecycle_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ void main() {
final client = fixture.getSut();
fixture.options.logBatcher = MockLogBatcher();

client.lifeCycleRegistry.registerCallback<OnBeforeCaptureLog>((event) {
fixture.options.lifecycleRegistry
.registerCallback<OnBeforeCaptureLog>((event) {
event.log.attributes['test'] =
SentryLogAttribute.string('test-value');
});
Expand Down Expand Up @@ -74,7 +75,8 @@ void main() {
final client = fixture.getSut();
fixture.options.logBatcher = MockLogBatcher();

client.lifeCycleRegistry.registerCallback<OnBeforeSendEvent>((event) {
fixture.options.lifecycleRegistry
.registerCallback<OnBeforeSendEvent>((event) {
event.event.release = '999';
});

Expand Down
6 changes: 4 additions & 2 deletions packages/dart/test/sentry_client_sdk_lifecycle_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ void main() {
final client = fixture.getSut();
fixture.options.logBatcher = MockLogBatcher();

client.lifeCycleRegistry.registerCallback<OnBeforeCaptureLog>((event) {
fixture.options.lifecycleRegistry
.registerCallback<OnBeforeCaptureLog>((event) {
event.log.attributes['test'] =
SentryLogAttribute.string('test-value');
});
Expand Down Expand Up @@ -74,7 +75,8 @@ void main() {
final client = fixture.getSut();
fixture.options.logBatcher = MockLogBatcher();

client.lifeCycleRegistry.registerCallback<OnBeforeSendEvent>((event) {
fixture.options.lifecycleRegistry
.registerCallback<OnBeforeSendEvent>((event) {
event.event.release = '999';
});

Expand Down
3 changes: 2 additions & 1 deletion packages/dart/test/sentry_client_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2007,7 +2007,8 @@ void main() {
final client = fixture.getSut();
fixture.options.logBatcher = MockLogBatcher();

client.lifeCycleRegistry.registerCallback<OnBeforeCaptureLog>((event) {
fixture.options.lifecycleRegistry
.registerCallback<OnBeforeCaptureLog>((event) {
event.log.attributes['test'] = SentryLogAttribute.string('test-value');
});

Expand Down
Loading
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.