fix(context): absorb native location stream errors in LocationManager#575
Merged
Conversation
Contributor
Author
|
@copilot resolve the merge conflicts in this pull request |
The native location plugin reports permission errors (e.g. PERMISSION_DENIED_NEVER_ASK) on its event channel. Without a handler they propagate as unhandled async errors to every subscriber (GeofenceProbe, MobilityProbe via MobilityFeatures.startListening, etc.). Absorb them once at the source via handleError on LocationManager.onLocationChanged.
faf2236 to
ec21c82
Compare
Contributor
|
@Zeroupper better to solve merge conflicts manually since often its risky |
Contributor
Author
@iarata Yes I agree, it was mostly just a trying out whether that could actually work. |
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
The native
locationplugin emits permission errors (e.g.PERMISSION_DENIED_NEVER_ASK) on its event channel. Without a handler they propagate as unhandled async errors to every subscriber ofLocationManager.onLocationChanged— includingMobilityFeatures.startListening, which subscribes without anonErrorcallback and crashes the isolate.Absorb them once at the source via
handleErroronLocationManager.onLocationChanged, logging a warning instead.Test plan
PlatformExceptionand a warning is logged.