fix(samples): Use float literal for session-replay sample rate#5764
Open
runningcode wants to merge 1 commit into
Open
fix(samples): Use float literal for session-replay sample rate#5764runningcode wants to merge 1 commit into
runningcode wants to merge 1 commit into
Conversation
The Android sample manifest set io.sentry.session-replay.session-sample-rate to the integer literal "1", which aapt stores as an int. ManifestMetadataReader reads it via Bundle.getFloat, which does not coerce an int-typed value and logs a framework warning before falling back to getInt on startup. Using the float literal "1.0" stores it as a float so getFloat succeeds and no warning is logged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
📲 Install BuildsAndroid
|
romtsn
approved these changes
Jul 15, 2026
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.
📜 Description
The Android sample app set the session replay sample rate as an integer literal:
aapt stores
"1"as an integer.ManifestMetadataReader.readDoublereads the value viaBundle.getFloat(key, -1), which does not coerce an int-typed value — it returns the default and the Android framework logs a warning like:The reader then falls back to
getInt, so the resulting value is still correct (1.0), but a framework warning is logged on every startup. Using the float literal"1.0"stores the value as a float, sogetFloatsucceeds on the first read and no warning is logged. This also matches the other sample-rate entries in the same manifest, which already use1.0.📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
#skip-changelog