feat(geolocation)!: migrate to @nativescript-community/perms v3 - #675
Open
NathanWalker wants to merge 1 commit into
Open
feat(geolocation)!: migrate to @nativescript-community/perms v3#675NathanWalker wants to merge 1 commit into
NathanWalker wants to merge 1 commit into
Conversation
perms v3 changed `check()`/`request()` to resolve to a `Status` string instead of the v2 `[Status, boolean]` tuple, and renamed the location `type: 'always'` option to `background: true`. Under v3 the old tuple reads silently degraded rather than failing: `authorizedStatus.includes(accessFine[0])` tested the first *character* of the status string, so `isEnabled()` always resolved false. BREAKING CHANGE: requires @nativescript-community/perms v3. Apps pinning perms v2 must upgrade alongside this release. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This was referenced Aug 24, 2026
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.
Part of the perms v2 → v3 migration.
@nativescript/local-notifications@7.0.0already requires perms v3; the remaining perms consumers in this repo still read the v2 shapes, so an app combining them gets whichever major npm hoists and the other side breaks.The bug
perms v3 resolves
check()to aStatusstring, not the v2[Status, boolean]tuple. The old code indexed into it:Against v3 that tests
'a'— the first character of'authorized'— which is not in['authorized', 'limited'].isEnabled()and_permissionIsGiven()therefore always resolved false, with no error thrown.Second v3 change
LocationOptions.typewas replaced bybackground:v3's
getPermissionsListgatesACCESS_BACKGROUND_LOCATIONonoptions.background === true, so the oldtype: 'always'silently stopped requesting background location. Thetype: ''on the foreground request was inert in both majors and is dropped.Behavior parity
Dropping the tuple's second element is safe at these call sites: v2 only returned a meaningful boolean there for
check('location', { type: 'always' }). These calls pass raw android permission strings, where v2 always returnedtrue.Verification
nx build geolocationclean against perms 3.0.11 (with #679 and #674 applied).Merge order
Needs #679 — the workspace cannot type-check against the wrong perms major. Merge that alongside the other three migrations.
🤖 Generated with Claude Code