Repository navigation
[geolocator] Fix concurrent getCurrentPosition calls and add getLocationAccuracy - #1220
Open
seungsoo47 wants to merge 3 commits into
Open
seungsoo47 wants to merge 3 commits into
seungsoo47 wants to merge 3 commits into
Conversation
…d methods getCurrentPosition kept a single pair of callbacks, so a call made while an earlier one was pending replaced them and the earlier call's Future never completed. Pending requests now join the request in flight and all complete with the same position or error. Upstream geolocator_apple had the same problem and fixed it the same way in Baseflow/flutter-geolocator#1813. Calling a method the plugin does not implement, such as getLocationAccuracy, called NotImplemented() on the moved-from result and crashed the app. Reply through result_ instead.
getLocationAccuracy fell through to NotImplemented, so Geolocator.getLocationAccuracy() threw MissingPluginException on Tizen. Tizen has a single location privilege and no approximate-location mode, so always report LocationAccuracyStatus.precise, as geolocator_windows does for its high-accuracy mode: https://github.com/Baseflow/flutter-geolocator/blob/main/geolocator_windows/windows/geolocator_plugin.cpp The unimplemented-method test now uses requestTemporaryFullAccuracy, which is iOS-only and still unimplemented. Bump the unreleased version to 1.2.0 since this adds a feature.
app_settings_manager_ was declared but never created, so openAppSettings and openLocationSettings called a member function through a null unique_ptr. This is undefined behavior; it only worked because the methods do not access any members.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
This PR fixes several stability issues in
geolocator_tizenand adds support forgetLocationAccuracy:getCurrentPositionnever completing when it is called again before an earlier call completes.requestTemporaryFullAccuracyis called.openAppSettingsoropenLocationSettingsis called.getLocationAccuracy.