Skip to content

Conversation

limbonaut
Copy link
Collaborator

@limbonaut limbonaut commented Sep 30, 2025

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.

  • Android:
    • Add sanitize_variant in src/sentry/android/android_util.{h,cpp} to normalize non-primitive Variant types and limit depth.
    • Use sanitization in AndroidSDK.set_context(...) and AndroidEvent.merge_context(...) to prevent nulls, and when serializing exception vars in AndroidEvent::add_exception.
  • Demo (project):
    • Replace TabContainer/Tests with TabContainer/Tools; show %RunTestsButton only if res://test/mobile_tests.gd exists.
    • Add TestDiverseContextButton and _on_test_diverse_context_button_pressed() in project/mobile.{tscn,gd} to set SentrySDK.set_context("diverse_context", ...) with varied types and capture a message.
  • Docs/Meta:
    • Update 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.

@limbonaut limbonaut added the Bug Something isn't working label Sep 30, 2025
@limbonaut limbonaut marked this pull request as ready for review September 30, 2025 11:35
cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

@limbonaut limbonaut merged commit 8c5c989 into main Oct 1, 2025
29 of 35 checks passed
@limbonaut limbonaut deleted the fix/android-variant-conv branch October 1, 2025 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Local variables on Android incorrectly displayed as null

2 participants