Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
buenaflor committed Apr 29, 2024
1 parent 615782e commit 04724d5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,10 @@ class NativeAppStartIntegration extends Integration<SentryFlutterOptions> {
// is not created therefore we need to create a transaction ourselves.
// We detect this by checking if the currentRouteName is null.
// This is a workaround since there is no api that tells us if
// the navigator observer exists or not.
// the navigator observer exists or not. The currentRouteName is always
// set during a didPush triggered by the navigator observer.
if (SentryNavigatorObserver.currentRouteName == null) {
const screenName = 'root /';
const screenName = SentryNavigatorObserver.rootScreenName;
// ignore: invalid_use_of_internal_member
final transaction = hub.startTransaction(screenName, SentrySpanOperations.uiLoad,
startTimestamp: appStartInfo.start);
Expand Down
6 changes: 5 additions & 1 deletion flutter/lib/src/navigation/sentry_navigator_observer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ class SentryNavigatorObserver extends RouteObserver<PageRoute<dynamic>> {
}

if (name == '/') {
name = 'root /';
name = rootScreenName;
}
final transactionContext = SentryTransactionContext(
name,
Expand Down Expand Up @@ -366,6 +366,10 @@ class SentryNavigatorObserver extends RouteObserver<PageRoute<dynamic>> {
_completedDisplayTracking = Completer();
_timeToDisplayTracker?.clear();
}

/// The name of the rootScreen
@internal
static const String rootScreenName = 'root /';
}

/// This class makes it easier to record breadcrumbs for events of Flutters
Expand Down

0 comments on commit 04724d5

Please sign in to comment.