fix: Sanitize Variant values on Android #397
Merged
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.
Sanitize Variant values on Android, specifically contexts and local variable values. This is important as certain Godot types cannot be converted to Android types, resulting in them being passed as nulls to the bridge layer. Also, introduce a tool to project for monkey-testing contexts with diverse value types.
Note
Sanitizes Android Variant payloads (contexts, exception vars) and adds a demo "Tools" tab with buttons to run tests and send diverse context.
sanitize_variant
insrc/sentry/android/android_util.{h,cpp}
to normalize non-primitiveVariant
types and limit depth.AndroidSDK.set_context(...)
andAndroidEvent.merge_context(...)
to prevent nulls, and when serializing exceptionvars
inAndroidEvent::add_exception
.TabContainer/Tests
withTabContainer/Tools
; show%RunTestsButton
only ifres://test/mobile_tests.gd
exists.TestDiverseContextButton
and_on_test_diverse_context_button_pressed()
inproject/mobile.{tscn,gd}
to setSentrySDK.set_context("diverse_context", ...)
with varied types and capture a message.CHANGELOG.md
with Android sanitization and context/local variable fix.Written by Cursor Bugbot for commit 685c35e. This will update automatically on new commits. Configure here.