Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load all pages of Facebook friends #30

Closed
wants to merge 1 commit into from
Closed

Conversation

dborkan
Copy link
Contributor

@dborkan dborkan commented Jun 29, 2015

Fixes #11

Tested in Chrome (by changing LIMIT to 2 and verifying that it successfully made the recursive calls to get all pages of friends).

}
var xhr = new XMLHttpRequest();
xhr.open('GET', url);
var thisFacebookSocialProvider = this;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thisFacebookSocialProvider is used within the xhr.onload callback. Within that callback, just using this won't give us what we want, and if we do the usual .bind(this) we won't be able to easily access this.response returned by the XHR

@salomegeo
Copy link

What does it mean to change the LIMIT to 2? could we have changed the LIMIT to 5000 and that would've fixed it?

@dborkan
Copy link
Contributor Author

dborkan commented Jun 30, 2015

I have about 10 FB friends who use uProxy. Changing the LIMIT to 2 for testing means that it ensures that the loadContacts_ method is called recursively. If I used LIMIT=100, all the contacts would be loaded after the first XHR request. We could change the limit to 5000 but at some point it could be slow, and it's not clear what limits might exist on Facebook's side. For now 100 seems like a safe option.

@dborkan
Copy link
Contributor Author

dborkan commented Feb 25, 2016

Closing this - we no longer load the users Facebook friends in freedom-social-firebase, but instead friends are added via invites

@dborkan dborkan closed this Feb 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants