File tree 8 files changed +23
-16
lines changed
flutter/lib/src/integrations
8 files changed +23
-16
lines changed Original file line number Diff line number Diff line change 2
2
3
3
## Unreleased
4
4
5
+ ### Fixes
6
+
7
+ - Missing slow and frozen frames for Auto transactions ([ #1172 ] ( https://github.com/getsentry/sentry-dart/pull/1172 ) )
8
+
5
9
### Dependencies
6
10
7
11
- Bump Android SDK from v6.9.1 to v6.9.2 ([ #1167 ] ( https://github.com/getsentry/sentry-dart/pull/1167 ) )
Original file line number Diff line number Diff line change @@ -129,6 +129,7 @@ class HubAdapter implements Hub {
129
129
waitForChildren: waitForChildren,
130
130
autoFinishAfter: autoFinishAfter,
131
131
trimEnd: trimEnd,
132
+ onFinish: onFinish,
132
133
);
133
134
134
135
@override
Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ import '../sentry_tracer.dart';
7
7
import '../tracing.dart' ;
8
8
import '../utils.dart' ;
9
9
10
+ typedef OnFinishedCallback = Future <void > Function ({DateTime ? endTimestamp});
11
+
10
12
class SentrySpan extends ISentrySpan {
11
13
final SentrySpanContext _context;
12
14
DateTime ? _endTimestamp;
@@ -19,7 +21,7 @@ class SentrySpan extends ISentrySpan {
19
21
20
22
SpanStatus ? _status;
21
23
final Map <String , String > _tags = {};
22
- Function ({ DateTime ? endTimestamp}) ? _finishedCallback;
24
+ OnFinishedCallback ? _finishedCallback;
23
25
24
26
@override
25
27
final SentryTracesSamplingDecision ? samplingDecision;
@@ -30,7 +32,7 @@ class SentrySpan extends ISentrySpan {
30
32
this ._hub, {
31
33
DateTime ? startTimestamp,
32
34
this .samplingDecision,
33
- Function ({ DateTime ? endTimestamp}) ? finishedCallback,
35
+ OnFinishedCallback ? finishedCallback,
34
36
}) {
35
37
_startTimestamp = startTimestamp? .toUtc () ?? _hub.options.clock ();
36
38
_finishedCallback = finishedCallback;
Original file line number Diff line number Diff line change @@ -9,6 +9,8 @@ import 'sentry_options.dart';
9
9
import 'sentry_span_interface.dart' ;
10
10
import 'sentry_tracer.dart' ;
11
11
12
+ typedef _OnScopeObserver = Future <void > Function (ScopeObserver observer);
13
+
12
14
/// Scope data to be sent with the event
13
15
class Scope {
14
16
/// How important this event is.
@@ -445,8 +447,7 @@ class Scope {
445
447
return clone;
446
448
}
447
449
448
- Future <void > _callScopeObservers (
449
- Future <void > Function (ScopeObserver ) action) async {
450
+ Future <void > _callScopeObservers (_OnScopeObserver action) async {
450
451
if (_options.enableScopeSync) {
451
452
for (final scopeObserver in _options.scopeObservers) {
452
453
await action (scopeObserver);
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ class Sentry {
41
41
@internal SentryOptions ? options,
42
42
}) async {
43
43
final sentryOptions = options ?? SentryOptions ();
44
- await _initDefaultValues (sentryOptions, appRunner );
44
+ await _initDefaultValues (sentryOptions);
45
45
46
46
try {
47
47
await optionsConfiguration (sentryOptions);
@@ -61,10 +61,7 @@ class Sentry {
61
61
await _init (sentryOptions, appRunner, callAppRunnerInRunZonedGuarded);
62
62
}
63
63
64
- static Future <void > _initDefaultValues (
65
- SentryOptions options,
66
- AppRunner ? appRunner,
67
- ) async {
64
+ static Future <void > _initDefaultValues (SentryOptions options) async {
68
65
_setEnvironmentVariables (options);
69
66
70
67
// Throws when running on the browser
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ class SentryTracer extends ISentrySpan {
23
23
@visibleForTesting
24
24
Timer ? get autoFinishAfterTimer => _autoFinishAfterTimer;
25
25
26
- Function ( SentryTracer ) ? _onFinish;
26
+ OnTransactionFinish ? _onFinish;
27
27
var _finishStatus = SentryTracerFinishStatus .notFinishing ();
28
28
late final bool _trimEnd;
29
29
@@ -51,7 +51,7 @@ class SentryTracer extends ISentrySpan {
51
51
bool waitForChildren = false ,
52
52
Duration ? autoFinishAfter,
53
53
bool trimEnd = false ,
54
- Function ( SentryTracer ) ? onFinish,
54
+ OnTransactionFinish ? onFinish,
55
55
}) {
56
56
_rootSpan = SentrySpan (
57
57
this ,
Original file line number Diff line number Diff line change @@ -226,7 +226,8 @@ void main() {
226
226
227
227
test ('callback called on finish' , () async {
228
228
var numberOfCallbackCalls = 0 ;
229
- final sut = fixture.getSut (finishedCallback: ({DateTime ? endTimestamp}) {
229
+ final sut =
230
+ fixture.getSut (finishedCallback: ({DateTime ? endTimestamp}) async {
230
231
numberOfCallbackCalls += 1 ;
231
232
});
232
233
@@ -269,7 +270,7 @@ class Fixture {
269
270
SentrySpan getSut ({
270
271
DateTime ? startTimestamp,
271
272
bool ? sampled = true ,
272
- Function ({ DateTime ? endTimestamp}) ? finishedCallback,
273
+ OnFinishedCallback ? finishedCallback,
273
274
Duration ? autoFinishAfter,
274
275
}) {
275
276
tracer = SentryTracer (context, hub, autoFinishAfter: autoFinishAfter);
Original file line number Diff line number Diff line change @@ -4,16 +4,17 @@ import 'package:flutter/widgets.dart';
4
4
import 'package:sentry/sentry.dart' ;
5
5
import '../sentry_flutter_options.dart' ;
6
6
7
+ typedef OnWidgetsBinding = WidgetsBinding Function ();
8
+
7
9
/// It is necessary to initialize Flutter method channels so that our plugin can
8
10
/// call into the native code.
9
11
class WidgetsFlutterBindingIntegration
10
12
extends Integration <SentryFlutterOptions > {
11
- WidgetsFlutterBindingIntegration (
12
- [WidgetsBinding Function ()? ensureInitialized])
13
+ WidgetsFlutterBindingIntegration ([OnWidgetsBinding ? ensureInitialized])
13
14
: _ensureInitialized =
14
15
ensureInitialized ?? WidgetsFlutterBinding .ensureInitialized;
15
16
16
- final WidgetsBinding Function () _ensureInitialized;
17
+ final OnWidgetsBinding _ensureInitialized;
17
18
18
19
@override
19
20
FutureOr <void > call (Hub hub, SentryFlutterOptions options) {
You can’t perform that action at this time.
0 commit comments