Skip to content

Commit 7c64a3f

Browse files
committed
update
1 parent f2ba992 commit 7c64a3f

File tree

2 files changed

+10
-13
lines changed

2 files changed

+10
-13
lines changed

dart/lib/src/sentry_tracer.dart

+3-3
Original file line numberDiff line numberDiff line change
@@ -109,15 +109,14 @@ class SentryTracer extends ISentrySpan {
109109
}
110110

111111
var _rootEndTimestamp = commonEndTimestamp;
112-
113112
if (_trimEnd && children.isNotEmpty) {
114113
final childEndTimestamps = children
115114
.where((child) => child.endTimestamp != null)
116115
.map((child) => child.endTimestamp!);
117116

118117
if (childEndTimestamps.isNotEmpty) {
119118
final oldestChildEndTimestamp =
120-
childEndTimestamps.reduce((a, b) => a.isAfter(b) ? a : b);
119+
childEndTimestamps.reduce((a, b) => a.isAfter(b) ? a : b);
121120
if (_rootEndTimestamp.isAfter(oldestChildEndTimestamp)) {
122121
_rootEndTimestamp = oldestChildEndTimestamp;
123122
}
@@ -363,7 +362,8 @@ class SentryTracer extends ISentrySpan {
363362
Dsn.parse(_hub.options.dsn!).publicKey,
364363
release: _hub.options.release,
365364
environment: _hub.options.environment,
366-
userId: null, // because of PII not sending it for now
365+
userId: null,
366+
// because of PII not sending it for now
367367
userSegment: user?.segment,
368368
transaction:
369369
_isHighQualityTransactionName(transactionNameSource) ? name : null,

flutter/lib/src/navigation/sentry_navigator_observer.dart

+7-10
Original file line numberDiff line numberDiff line change
@@ -212,16 +212,16 @@ class SentryNavigatorObserver extends RouteObserver<PageRoute<dynamic>> {
212212
}
213213
}
214214

215-
Future<ISentrySpan?> _startTransaction(Route<dynamic>? route) async {
215+
Future<void> _startTransaction(Route<dynamic>? route) async {
216216
if (!_enableAutoTransactions) {
217-
return null;
217+
return;
218218
}
219219

220220
String? name = _getRouteName(route);
221221
final arguments = route?.settings.arguments;
222222

223223
if (name == null) {
224-
return null;
224+
return;
225225
}
226226

227227
if (name == '/') {
@@ -260,7 +260,7 @@ class SentryNavigatorObserver extends RouteObserver<PageRoute<dynamic>> {
260260
// if _enableAutoTransactions is enabled but there's no traces sample rate
261261
if (_transaction is NoOpSentrySpan) {
262262
_transaction = null;
263-
return null;
263+
return;
264264
}
265265

266266
if (arguments != null) {
@@ -272,18 +272,15 @@ class SentryNavigatorObserver extends RouteObserver<PageRoute<dynamic>> {
272272
});
273273

274274
await _native?.beginNativeFramesCollection();
275-
276-
return _transaction;
277275
}
278276

279277
Future<void> _startTimeToDisplayTracking(Route<dynamic>? route) async {
280278
_completedDisplayTracking = Completer<void>();
281-
final routeName = _getRouteName(route);
282-
_currentRouteName = routeName;
283-
284279
final arguments = route?.settings.arguments;
285-
final transaction = await _startTransaction(route);
280+
await _startTransaction(route);
281+
final transaction = _transaction;
286282
if (transaction == null) return;
283+
final routeName = _getRouteName(route);
287284
await _timeToDisplayTracker?.startTracking(
288285
transaction, routeName, arguments);
289286
_completedDisplayTracking?.complete();

0 commit comments

Comments
 (0)