feat(imagepicker)!: migrate to @nativescript-community/perms v3 - #677
Open
NathanWalker wants to merge 1 commit into
Open
feat(imagepicker)!: migrate to @nativescript-community/perms v3#677NathanWalker wants to merge 1 commit into
NathanWalker wants to merge 1 commit into
Conversation
perms v3 changed single-permission `request()` to resolve to a `Status` string instead of the v2 `[Status, boolean]` tuple; the multi-permission `MultiResult` shape is unchanged. Under v3 `mapResult` took the MultiResult branch for a plain status string, found none of the media permission keys on it, and returned `authorized: true` regardless of what the user chose. BREAKING CHANGE: `AuthorizationResult.details` is now `MultiResult | Status` rather than `MultiResult | Result`, and perms v3 is required. 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 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.
The bug
perms v3 resolves single-permission
request()to aStatusstring instead of the v2[Status, boolean]tuple. The multi-permissionMultiResultshape is unchanged, andmapResultdiscriminated between the two by array-shape:A v3 status string is not an array, so it fell to the
MultiResultbranch, found none ofREAD_MEDIA_IMAGES/READ_MEDIA_VIDEOon it, and leftauthorizedat itstrueinitializer.authorize()reported success no matter what the user chose — including on iOS, whererequest('photo')always returns a bare status.Discriminating on
typeof result === 'string'covers both call shapes correctly.Breaking
AuthorizationResult.detailsis a public type and changes:Resultis generic in v3 (Result<T>) and no longer names the single-permission result at all —Statusdoes.Verification
nx build imagepickerclean against perms 3.0.11 (with #679 applied).Merge order
Needs #679. Merge alongside the other three migrations.
🤖 Generated with Claude Code