fix: Propagate app context on Android#2557
fix: Propagate app context on Android#2557bitsandfoxes wants to merge 3 commits intofeat/app-runner-androidfrom
Conversation
Semver Impact of This PR🟢 Patch (bug fixes) 📋 Changelog PreviewThis is how your changes will appear in the changelog. Bug Fixes 🐛
Internal Changes 🔧Deps
🤖 This preview updates automatically when you update the PR. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| RunJniSafe(() => | ||
| { | ||
| using var app = new AndroidJavaObject("io.sentry.protocol.App"); | ||
| app.SetIfNotNull("appStartTime", AppStartTime); |
There was a problem hiding this comment.
String set on likely Date-typed Java field via JNI
Medium Severity
The appStartTime field on io.sentry.protocol.App in the sentry-java SDK is typically a Date type, but SetIfNotNull("appStartTime", AppStartTime) passes an ISO 8601 string. Since no valueClass is provided, SetIfNotNull calls javaObject.Set(property, value!) directly, which uses a String JNI signature. If the actual field type is Date, this would either fail at JNI field resolution (crashing the entire RunJniSafe lambda, which also prevents GPU context from syncing — a regression) or silently corrupt the field causing a ClassCastException during serialization. The buildType field is fine since it's a String in Java.


Following #2548
Added missing sync of app contexts.