Repository navigation
feat(nav3): [Part 2] Add an argument source for encoding back stack entry properties via kotlinx.serialization - #6751
Open
0xadam-brown wants to merge 1 commit into
Conversation
Contributor
|
Contributor
PR risk: mediumFor commit Main concerns: data sent to Sentry, host performance, reach. This label is a hint for reviewers, not an approval. |
This was referenced Nov 24, 2026
📲 Install BuildsAndroid
|
0xadam-brown
force-pushed
the
feat/nav3-serial-name-mappers-argument-source
branch
from
December 1, 2026 01:31
849c9d0 to
ef7030c
Compare
0xadam-brown
force-pushed
the
feat/nav3-serial-name-mappers-8
branch
from
December 1, 2026 01:31
f4a7b52 to
d6095b5
Compare
0xadam-brown
marked this pull request as ready for review
December 1, 2026 01:49
0xadam-brown
requested review from
markushi and
runningcode
and removed request for
a team
December 1, 2026 01:49
Add KotlinxArgumentSource, the arguments the SerialNameAndProperties mapper will return. It encodes an entry's properties only when they're read or written, so an entry whose arguments the update's budget has already ruled out isn't encoded at all. Read as a map, it encodes once and caches the result; written to the sanitizer's sink, it encodes against the update's shared budget. ArgumentSanitizer now lets arguments that are an ArgumentSource write themselves, and a source can drop its arguments without a warning when it has reported the failure itself. Add the encoding_failed drop reason for entries whose properties can't be encoded. Co-Authored-By: Claude Opus 5.5 <[email protected]>
0xadam-brown
force-pushed
the
feat/nav3-serial-name-mappers-argument-source
branch
from
December 1, 2026 10:01
ef7030c to
81bf950
Compare
0xadam-brown
force-pushed
the
feat/nav3-serial-name-mappers-8
branch
from
December 1, 2026 10:01
d6095b5 to
7e35dad
Compare
runningcode
approved these changes
Dec 1, 2026
runningcode
left a comment
Contributor
There was a problem hiding this comment.
LGTM! Just one comment below!
| private val backStackEntry: Any, | ||
| private val serializer: KSerializer<Any>, | ||
| private val onFailure: (Throwable) -> Unit, | ||
| ) : AbstractMap<String, Any?>(), ArgumentSource { |
Contributor
There was a problem hiding this comment.
So my clanker tells me that SentryBackStackEntry.equals and hashCode delegate to arguments. This means that comparing two entries or putting one in a HashSet now runs the app's serializers on whatever thread we're currently on.
The issue is that the java spec says that equals shouldn't have side effects!
My clanker thinks the code could be vastly simplified if we removed the laziness here.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Stack (Nav3 SerialNameAndProperties Mapper)
This stack follows the
SerialNamestack (#6780) and is based on its last PR, #6783.📜 Description
PR adds
KotlinxArgumentSource, theArgumentSource(see Part 1) that the built-inSerialNameAndPropertiesmapper (Part 3) uses to turn a back stack entry's kotlinx.serialization properties into Sentry arguments.ArgumentSanitizernow lets arguments that are anArgumentSourcewrite themselves, and a source can drop its arguments without a warning when it has already reported the failure itself.Nothing uses the source yet; Part 3 wires it into
SerialNameAndProperties. It was split out of that PR to keep it reviewable.💡 Motivation and Context
Implements the
ArgumentSourcediscussed in #6705 that we need in order to extract properties from the host app's back stack (via kotlinx.serialization).addresses: JAVA-787 (link)
💚 How did you test it?
📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
Continue with Part 3: Add the built-in SerialNameAndProperties mapper.
#skip-changelog