Skip to content

fix(context): absorb native location stream errors in LocationManager#575

Merged
Zeroupper merged 1 commit into
mainfrom
1.12.0-perm-hotfix
Jun 12, 2026
Merged

fix(context): absorb native location stream errors in LocationManager#575
Zeroupper merged 1 commit into
mainfrom
1.12.0-perm-hotfix

Conversation

@Zeroupper

@Zeroupper Zeroupper commented May 27, 2026

Copy link
Copy Markdown
Contributor

Summary

The native location plugin 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 of LocationManager.onLocationChanged — including MobilityFeatures.startListening, which subscribes without an onError callback and crashes the isolate.

Absorb them once at the source via handleError on LocationManager.onLocationChanged, logging a warning instead.

Test plan

  • Run a study with location-dependent probes on a device where location permission is denied or revoked mid-run; confirm no unhandled PlatformException and a warning is logged.
  • Verify normal location streaming still works when permission is granted.

@Zeroupper

Copy link
Copy Markdown
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.
@Zeroupper Zeroupper force-pushed the 1.12.0-perm-hotfix branch from faf2236 to ec21c82 Compare May 27, 2026 12:34
@Zeroupper Zeroupper changed the title fix(context): stop unhandled location permission errors crashing probes fix(context): absorb native location stream errors in LocationManager May 27, 2026

Copilot AI commented May 27, 2026

Copy link
Copy Markdown

@copilot resolve the merge conflicts in this pull request

Resolved. The branch is now synced on ec21c82, and PR #575 is mergeable (mergeable_state: clean).

@Zeroupper Zeroupper requested a review from bardram May 27, 2026 13:19
@Zeroupper Zeroupper added the bug Something isn't working label May 27, 2026
@iarata

iarata commented May 27, 2026

Copy link
Copy Markdown
Contributor

@Zeroupper better to solve merge conflicts manually since often its risky

@Zeroupper

Zeroupper commented May 28, 2026

Copy link
Copy Markdown
Contributor Author

@Zeroupper better to solve merge conflicts manually since often its risky

@iarata Yes I agree, it was mostly just a trying out whether that could actually work.

@bardram bardram left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Zeroupper Zeroupper merged commit 7dfd30a into main Jun 12, 2026
1 check passed
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.

4 participants