Skip to content

Commit d42fc93

Browse files
committed
Ensure entry appears before its arguments when Sentry UI displays back stack context + drop visually redundant "arguments_" prefix from drop reason
1 parent efb603b commit d42fc93

4 files changed

Lines changed: 11 additions & 11 deletions

File tree

‎sentry-android-navigation3/src/main/kotlin/io/sentry/compose/navigation3/BackStackConverter.kt‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ internal data class NormalizedSentryBackStackEntry(
432432
* ```
433433
* {
434434
* "entry": "/ProductScreen"
435-
* "arguments": {
435+
* "entry_arguments": {
436436
* "product_id": 12345
437437
* "promo_id:": "spring-marketing-drive-2026"
438438
* }
@@ -441,7 +441,7 @@ internal data class NormalizedSentryBackStackEntry(
441441
*/
442442
fun serialize(): Map<String, Any?> = buildMap {
443443
put("entry", name)
444-
argumentsWithMetadata().takeIf { it.isNotEmpty() }?.let { put("arguments", it) }
444+
argumentsWithMetadata().takeIf { it.isNotEmpty() }?.let { put("entry_arguments", it) }
445445
}
446446
}
447447

@@ -461,6 +461,6 @@ internal enum class ArgumentDropReason(
461461
SANITIZATION_FAILED("sanitization_failed");
462462

463463
companion object {
464-
const val ARGUMENT_DROP_REASON_KEY = "arguments_dropped_by_sentry"
464+
const val ARGUMENT_DROP_REASON_KEY = "dropped_by_sentry"
465465
}
466466
}

‎sentry-android-navigation3/src/test/kotlin/io/sentry/compose/navigation3/BackStackConverterTest.kt‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ class BackStackConverterTest {
619619

620620
assertThat(routes.map(NormalizedSentryBackStackEntry::serialize))
621621
.containsExactly(
622-
mapOf("entry" to "/SettingsScreen", "arguments" to mapOf("section" to "privacy")),
622+
mapOf("entry" to "/SettingsScreen", "entry_arguments" to mapOf("section" to "privacy")),
623623
mapOf("entry" to "/ProfileScreen"),
624624
)
625625
.inOrder()
@@ -637,7 +637,7 @@ class BackStackConverterTest {
637637
.isEqualTo(
638638
mapOf(
639639
"entry" to "/HomeScreen",
640-
"arguments" to mapOf(ARGUMENT_DROP_REASON_KEY to "max_argument_count_exceeded"),
640+
"entry_arguments" to mapOf(ARGUMENT_DROP_REASON_KEY to "max_argument_count_exceeded"),
641641
)
642642
)
643643
}

‎sentry-android-navigation3/src/test/kotlin/io/sentry/compose/navigation3/BackStackObserverTest.kt‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -273,10 +273,10 @@ class BackStackObserverTest {
273273
assertThat(fixture.scope.navigationBackStack())
274274
.isEqualTo(
275275
listOf(
276-
mapOf("entry" to "/ProfileScreen", "arguments" to mapOf("userId" to "123")),
276+
mapOf("entry" to "/ProfileScreen", "entry_arguments" to mapOf("userId" to "123")),
277277
mapOf(
278278
"entry" to "/HomeScreen",
279-
"arguments" to mapOf(ARGUMENT_DROP_REASON_KEY to "max_argument_count_exceeded"),
279+
"entry_arguments" to mapOf(ARGUMENT_DROP_REASON_KEY to "max_argument_count_exceeded"),
280280
),
281281
)
282282
)
@@ -461,7 +461,7 @@ class BackStackObserverTest {
461461
assertThat(transaction.navigationBackStack())
462462
.isEqualTo(
463463
listOf(
464-
mapOf("entry" to "/ProfileScreen", "arguments" to mapOf("userId" to "123")),
464+
mapOf("entry" to "/ProfileScreen", "entry_arguments" to mapOf("userId" to "123")),
465465
mapOf("entry" to "/HomeScreen"),
466466
)
467467
)
@@ -697,7 +697,7 @@ class BackStackObserverTest {
697697
listOf(
698698
mapOf(
699699
"entry" to NormalizedSentryBackStackEntry.UNKNOWN_ENTRY_NAME,
700-
"arguments" to mapOf(ARGUMENT_DROP_REASON_KEY to "mapping_failed"),
700+
"entry_arguments" to mapOf(ARGUMENT_DROP_REASON_KEY to "mapping_failed"),
701701
),
702702
mapOf("entry" to NormalizedSentryBackStackEntry.UNKNOWN_ENTRY_NAME),
703703
mapOf("entry" to "/home"),
@@ -732,7 +732,7 @@ class BackStackObserverTest {
732732
mapOf("entry" to "/settings"),
733733
mapOf(
734734
"entry" to NormalizedSentryBackStackEntry.UNKNOWN_ENTRY_NAME,
735-
"arguments" to mapOf(ARGUMENT_DROP_REASON_KEY to "mapping_failed"),
735+
"entry_arguments" to mapOf(ARGUMENT_DROP_REASON_KEY to "mapping_failed"),
736736
),
737737
mapOf("entry" to NormalizedSentryBackStackEntry.UNKNOWN_ENTRY_NAME),
738738
mapOf("entry" to "/home"),

‎sentry-android-navigation3/src/test/kotlin/io/sentry/compose/navigation3/SentryNavEffectTest.kt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ class SentryNavEffectTest {
440440
assertThat(fixture.scope.navigationBackStack())
441441
.isEqualTo(
442442
listOf(
443-
mapOf("entry" to "/ProfileRoute", "arguments" to mapOf("userId" to "123")),
443+
mapOf("entry" to "/ProfileRoute", "entry_arguments" to mapOf("userId" to "123")),
444444
mapOf("entry" to "/HomeRoute"),
445445
)
446446
)

0 commit comments

Comments
 (0)