Restore permissionGranted during -checkAuthorizationOnCompletion:#21
Open
JamesBucanek wants to merge 3 commits intodevedup:masterfrom
Open
Restore permissionGranted during -checkAuthorizationOnCompletion:#21JamesBucanek wants to merge 3 commits intodevedup:masterfrom
JamesBucanek wants to merge 3 commits intodevedup:masterfrom
Conversation
Patched in the bug fix from lysannschlegel
…ion:. Added a new FKPermissionForStringPermission() function to complement FKPermissionStringForPermission(). Eliminated some redundant code in -userAuthorizationURLWithRequestToken: by calling FKPermissionStringForPermission().
Owner
|
Shit, sorry I haven't merged the patch by lysannschlegel yet. I've been catching up a bit so I'll get this done as soon as possible . |
Author
|
Oversight: Flickr expects the permissions parameter to be lowercase, but FKPermissionStringForPermission() returns uppercase. A -lowercaseString message solves that... |
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.
I tracked down what I thought was a Flickr problem to a bug in FlickrKit. It turns out that FlickrKit sets the permissionGranted property during -beginAuthWithCallbackURL:permission:completion:, but it doesn’t preserve it in user defaults nor does it restore it during -checkAuthorizationOnCompletion:.
The end result is that permissionGranted eventually gets reset back to FKPermissionRead and then any of the model-based methods (specifically not “upload”) that require WRITE or DELETE access fail when called. (See -[FlickrKit call:maxCacheAge:completion:]).
Ultimately, I decided to refresh the permissionsGranted property from the value returned from the flickr.auth.checkToken call, rather than simply storing it in user defaults, simply because it could (in theory) have changed on Flickr’s end, and this will keep it up-to-date.
This pull request also includes the patch by lysannschlegel that fixes the problem with the NSLocalizedDescriptionKey in the NSError userInfo dictionary. Mostly because (a) I’m tired of reapplying this patch after every new FlickrKit update and (b) I have no idea how to separate this fix from my pull request. :(