Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Rolling up a few pull requests -- thanks!

Summary:
This diff rolls-up the following pull request -
  * 449      - SevaUA
  * 446, 445 - adamvduke
  * 435      - deyton

Test Plan: manual, used hackbook to exercise impacted code

Reviewers: yariv, mmarucheck, vijaye, caabernathy

Reviewed By: vijaye

CC: gregschechte, selekman

Differential Revision: https://phabricator.fb.com/D448786

Task ID: 1021338, 981999
  • Loading branch information...
commit 50779444de3076b141023d04b0642f7936f2c5d4 1 parent 0fb2954
@onebit onebit authored
View
7 src/FBDialog.m
@@ -500,7 +500,12 @@ - (void)webViewDidFinishLoad:(UIWebView *)webView {
- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error {
// 102 == WebKitErrorFrameLoadInterruptedByPolicyChange
- if (!([error.domain isEqualToString:@"WebKitErrorDomain"] && error.code == 102)) {
+ // -999 == "Operation could not be completed", note -999 occurs when the user clicks away before
+ // the page has completely loaded, if we find cases where we want this to result in dialog failure
+ // (usually this just means quick-user), then we should add something more robust here to account
+ // for differences in application needs
+ if (!(([error.domain isEqualToString:@"NSURLErrorDomain"] && error.code == -999) ||
+ ([error.domain isEqualToString:@"WebKitErrorDomain"] && error.code == 102))) {
[self dismissWithError:error animated:YES];
}
}
View
4 src/Facebook.h
@@ -16,8 +16,8 @@
#import "FBLoginDialog.h"
#import "FBRequest.h"
-#import "FBFrictionlessRequestSettings.h"
+@class FBFrictionlessRequestSettings;
@protocol FBSessionDelegate;
/**
@@ -36,7 +36,7 @@
NSString* _appId;
NSString* _urlSchemeSuffix;
NSArray* _permissions;
- BOOL _isExtendingAccessToken;
+ FBRequest *_requestExtendingAccessToken;
NSDate* _lastAccessTokenUpdate;
FBFrictionlessRequestSettings* _frictionlessRequestSettings;
}
View
12 src/Facebook.m
@@ -15,6 +15,7 @@
*/
#import "Facebook.h"
+#import "FBFrictionlessRequestSettings.h"
#import "FBLoginDialog.h"
#import "FBRequest.h"
#import "JSON.h"
@@ -116,6 +117,8 @@ - (id)initWithAppId:(NSString *)appId
* Override NSObject : free the space
*/
- (void)dealloc {
+ // this is the one case where the delegate is this object
+ _requestExtendingAccessToken.delegate = nil;
for (FBRequest* _request in _requests) {
[_request removeObserver:self forKeyPath:requestFinishedKeyPath];
}
@@ -344,14 +347,13 @@ - (void)authorize:(NSArray *)permissions {
* applicationDidBecomeActive: UIApplicationDelegate method.
*/
- (void)extendAccessToken {
- if (_isExtendingAccessToken) {
+ if (_requestExtendingAccessToken) {
return;
}
- _isExtendingAccessToken = YES;
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
@"auth.extendSSOAccessToken", @"method",
nil];
- [self requestWithParams:params andDelegate:self];
+ _requestExtendingAccessToken = [self requestWithParams:params andDelegate:self];
}
/**
@@ -803,11 +805,11 @@ - (void)fbDialogNotLogin:(BOOL)cancelled {
// These delegate methods are only called for requests that extendAccessToken initiated
- (void)request:(FBRequest *)request didFailWithError:(NSError *)error {
- _isExtendingAccessToken = NO;
+ _requestExtendingAccessToken = nil;
}
- (void)request:(FBRequest *)request didLoad:(id)result {
- _isExtendingAccessToken = NO;
+ _requestExtendingAccessToken = nil;
NSString* accessToken = [result objectForKey:@"access_token"];
NSString* expTime = [result objectForKey:@"expires_at"];
View
10 src/facebook-ios-sdk.xcodeproj/project.pbxproj
@@ -248,7 +248,10 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
- ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+ ARCHS = (
+ "$(ARCHS_STANDARD_32_BIT)",
+ armv6,
+ );
COPY_PHASE_STRIP = NO;
DSTROOT = /tmp/facebook_ios_sdk.dst;
GCC_DYNAMIC_NO_PIC = NO;
@@ -268,7 +271,10 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
- ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+ ARCHS = (
+ "$(ARCHS_STANDARD_32_BIT)",
+ armv6,
+ );
DSTROOT = /tmp/facebook_ios_sdk.dst;
GCC_MODEL_TUNING = G5;
GCC_PRECOMPILE_PREFIX_HEADER = YES;

2 comments on commit 5077944

@appsperhaps

This is causing an infinite recursion by checking _requestExtendingAccessToken instead of the BOOL. Request is never returned from openUrl to be used. Previously the BOOL was getting set YES once and that ensures that extendAccessToken gets runs once.

@onebit
Collaborator

Thanks for the comment! I put it back to using the bool, to determine whether or not to short-circuit.

Please sign in to comment.
Something went wrong with that request. Please try again.