Repository navigation
fix(windows): add missing == 0 to openAppSettings compare - #1571
Open
ibrahim-iqbal wants to merge 4 commits into
Open
ibrahim-iqbal wants to merge 4 commits into
ibrahim-iqbal wants to merge 4 commits into
Conversation
) std::string::compare returns 0 on a match, so the second operand of the || was always true except when methodName was literally "openAppSettings" — swapping the two arms. openAppSettings fell through to NotImplemented() (a MissingPluginException on the Dart side instead of a result), while every other unrecognized method name was silently handled as Success(false), hiding real NotImplemented gaps from callers.
ibrahim-iqbal
force-pushed
the
fix/1564-windows-openappsettings-compare
branch
from
October 12, 2026 06:28
6cc97d4 to
a4bf3e6
Compare
codivo-erill
added a commit
to codivo-erill/flutter-permission-handler
that referenced
this pull request
Nov 3, 2026
openAppSettings fell through to NotImplemented because of a missing '== 0' in the method name compare (see Baseflow#1571). Open ms-settings:privacy via ShellExecuteW instead, like geolocator_windows does.
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## main #1571 +/- ##
===========================================
- Coverage 89.84% 71.42% -18.42%
===========================================
Files 7 1 -6
Lines 128 35 -93
===========================================
- Hits 115 25 -90
+ Misses 13 10 -3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Fixes #1564
Bug
In
permission_handler_windows_plugin.cpp:std::string::comparereturns0on a match. The second operand is missing== 0, so it evaluates to the non-zero (truthy) comparison result for every method name except"openAppSettings"— swapping the two arms of the condition:openAppSettingsis the only method name that falls through toresult->NotImplemented()→MissingPluginExceptionon the Dart side, instead of a result.Success(false), instead of reportingNotImplemented— hiding real gaps from callers.Fix
One-character fix: add
== 0to the second compare, restoring both behaviors —openAppSettingsnow returnsSuccess(false)likeshouldShowRequestPermissionRationale, and unrecognized methods correctly reportNotImplemented.Testing
No Windows device available to run this locally; the fix is a direct correction of the documented logic inversion (
std::string::comparesemantics are unambiguous here, and the diff is one token).