You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit c3bbd3c
Browse filesBrowse the repository at this point in the historyBrowse files
feat(nav3): Record why back stack entries are /unknown
An entry recorded as /unknown didn't say why, so outside debug logs a mapper that threw,
returned a blank name, or chose not to name an entry all looked the same, as did the built-in
mapper's failures, many of which only happen in minified release builds. Record the reason next
to the entry as unnamed_reason: entry_unnamed_reason in the back stack context,
to_unnamed_reason and from_unnamed_reason on breadcrumbs, and unnamed_reason in the nav
transaction's data.
The values are mapping_failed, blank_name, and unmapped for any mapper, and
not_serializable, generic_type, serializer_not_found, serializer_lookup_threw, or
kotlinx_serialization_version for SerialName. A mapper that throws now records mapping_failed as
its unnamed reason instead of as its arguments' drop reason, so one cause has one name.
SerialName returns null, which is public API, so it reports its reason through an internal
per-thread side channel that the converter reads around each mapping call. A custom mapper that
forwards SerialName's null forwards its reason too. Each type's reason is cached with its
failure. Generic @serializable types are now detected before the serializer lookup, which can't
find their serializers either, so that they record generic_type and log a warning that says so.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,8 @@
10
10
### Features
11
11
12
12
- Nav3: Add `BackStackEntryMapper.SerialName`, a convenience mapper that names back stack entries after their kotlinx.serialization serial names ([#6703](https://github.com/getsentry/sentry-java/pull/6703))
13
+
- Nav3: Record why a back stack entry is `/unknown`, as `unnamed_reason` next to it in the back stack record (`entry_unnamed_reason`), breadcrumbs (`to_unnamed_reason`, `from_unnamed_reason`), and navigation transactions (e.g., `not_serializable` or `serializer_not_found` for the built-in mappers, `unmapped` if a custom mapper returns `null`) ([#6781](https://github.com/getsentry/sentry-java/pull/6781))
14
+
- A mapper that throws now records `"entry_unnamed_reason": "mapping_failed"` instead of `"dropped_by_sentry": "mapping_failed"` in the entry's arguments
Copy file name to clipboardExpand all lines: sentry-android-navigation3/src/main/kotlin/io/sentry/compose/navigation3/internal/backstack/BackStackConverter.kt
Copy file name to clipboardExpand all lines: sentry-android-navigation3/src/main/kotlin/io/sentry/compose/navigation3/internal/backstack/BackStackObserver.kt
Copy file name to clipboardExpand all lines: sentry-android-navigation3/src/main/kotlin/io/sentry/compose/navigation3/internal/backstack/BuiltInBackStackEntryMappers.kt
+3-2Lines changed: 3 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -91,8 +91,8 @@ internal class DeferredBackStackEntryMapper(
91
91
/**
92
92
* A fallback for when a built-in [BackStackEntryMapper] isn't supported by the host app.
93
93
*
94
-
* Maps every back stack entry to `null`, which Sentry records as [UNKNOWN_ENTRY_NAME]. Logs once
95
-
* per entry type.
94
+
* Maps every back stack entry to `null`, which Sentry records as [UNKNOWN_ENTRY_NAME] with
95
+
* [UnnamedReason.KOTLINX_SERIALIZATION_VERSION]. Logs once per entry type.
96
96
*/
97
97
internalclassUnavailableBackStackEntryMapper(
98
98
privatevallogger: () ->ILogger,
@@ -113,6 +113,7 @@ internal class UnavailableBackStackEntryMapper(
0 commit comments