MySpace Open Platform

A Place For Developers

Welcome Developers!

in

Welcome!

in

number returned by getTotalSize() after newFetchPeopleRequest is incorrect in 0.8

Last post 01-30-2009 2:33 AM by Artem. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 01-07-2009 6:02 PM

    number returned by getTotalSize() after newFetchPeopleRequest is incorrect in 0.8

    Hi MDP,

    I ran the code in 0.7 and 0.8. The number reported by ownerFriends.getTotalSize() are 9 and 5 respectedly. According to 0.8 documentation

    opensocial.collection.getTotalSize()
    Gets the total size of the larger result set that this collection belongs to.

    I have a total of 9 friends so 0.7 is reporting the correct number but not in 0.8.

    This is important because when a user has a lot of friends, it will be nice to able to do paging. 

    It will be greatly appreciated if you could look into this issue.


      function getFriends() {    
        var req = opensocial.newDataRequest();
        var opt_params = {};
                
        opt_params[opensocial.DataRequest.PeopleRequestFields.FIRST] = 1;
        opt_params[opensocial.DataRequest.PeopleRequestFields.MAX] = 5;

        var idSpec = (opensocial.newIdSpec? opensocial.newIdSpec({'userId':'OWNER', 'groupId':'FRIENDS'}):"OWNER_FRIENDS");
        req.add(req.newFetchPeopleRequest(idSpec, opt_params),'ownerFriends');
        req.send(getFriends_callback);
      }
     

    function getFriends_callback(dataResponse) {
        var ownerFriends = dataResponse.get('ownerFriends').getData();
        console.log(ownerFriends.getTotalSize());
      }

  • 01-08-2009 8:18 PM In reply to

    Re: number returned by getTotalSize() after newFetchPeopleRequest is incorrect in 0.8

     Thanks for the feedback, I'll check in with the team about this. 

    Rhonda

     

  • 01-09-2009 2:11 AM In reply to

    • Artem
    • Top 200 Contributor
    • Joined on 10-08-2008
    • Posts 24

    Re: number returned by getTotalSize() after newFetchPeopleRequest is incorrect in 0.8

    Hi, Rhonda,

    I confirm that we have the same bug when switching our application to OS 0.8. Result of getTotalSize() is always equal to size() for newFetchPeopleRequest results and never exceeds 20. This makes getting large amounts of friends tricky since there are still bugs with pagination that I reported earlier (MAX is ignored when it is large then 20, timeout for the last set of data): http://developer.myspace.com/Community/forums/p/6335/31749.aspx

    Regards,
    Artem

  • 01-30-2009 2:33 AM In reply to

    • Artem
    • Top 200 Contributor
    • Joined on 10-08-2008
    • Posts 24

    Re: number returned by getTotalSize() after newFetchPeopleRequest is incorrect in 0.8

     bug is still reproducable, bumping

Page 1 of 1 (4 items)