hello.js icon indicating copy to clipboard operation
hello.js copied to clipboard

Yahoo GET me/friends pagination not working

Open SkyHacks opened this issue 10 years ago • 1 comments

I started with 3 demo contacts in my Yahoo account and hello.js returned them all in the data array. Once I added a 4th contact, it began paging the results. I have attempted to follow the steps outlined in the paging example but anytime I pass in the resp.paging.next path to the callback, it returns a null query like this:

{
 query: {
  count: 0,
  created: "2015-12-09T16:11:04Z",
  lang: "en-US",
  results: null
 }
}

I have checked that the 'next' path is correct and the callback works for the first few contacts so I believe that everything is setup correctly. I am recursively calling next to try and get all of the contacts.

I'm in the middle of trying to debug the issue, but here is the function that I'm working with:

getYahooFriends('me/friends')
var friendsArray = []

function getYahooFriends (path) {
  hello(network).api(path, {limit: 100})
  .then(function (r) {
    friendsArray.push(r);
    console.log(path,r);

   if (r.paging && r.paging.next) {
      getYahooFriends(r.paging.next);
    }  else {
      defer.resolve(friendsArray);
    }                          
  }, function (err) {
    console.log(err);
    defer.reject(err);
  });
}

I get the same result from the test page --> https://adodson.com/hello.js/tests/#hello-x-api-path--method--data--callback--

The first page returns 3 contacts but the next button returns the null query.

Here is a screenshot of my contacts: screen shot 2015-12-09 at 9 12 56 am

SkyHacks avatar Dec 09 '15 18:12 SkyHacks

I believe this is a duplicate of #375

MrSwitch avatar Jan 06 '16 21:01 MrSwitch