Fix Android initConnection success propagation#19
Open
elliottyu19 wants to merge 1 commit into
Open
Conversation
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.
Summary
This PR was generated by the Terra support agent from an ops investigation and needs engineering review.
Android Flutter bridge
initConnectionwas always returningsuccess: truefrom the native callback, even when the underlying Android SDK reportedsuccess = falseand returned an error. That caused Flutter callers to treat Samsung init/permission failures as successful, masking permission setup issues in release builds.Root cause
In
android/src/main/java/co/tryterra/terra_flutter_bridge/TerraFlutterPlugin.java, theinitConnectioncallback built the result map with a hardcodedmap.put("success", true)instead of forwarding the native callback boolean.Fix
Replace the hardcoded success value with the actual native callback value:
map.put("success", success)This keeps error propagation unchanged while allowing Flutter apps to detect failed Samsung initialization/permission flows correctly.
How to test
initConnectionfor Samsung.success = false(for example, deny or interrupt the Samsung permission/init flow, or use a scenario known to fail in release builds).success: falseand includes the native error message when present.success: true.