MySpace Open Platform

A Place For Developers

Welcome Developers!

in

Welcome!

in

OS 0.8: newFetchPeopleRequest creates produces errors in myopenspace.v08.155.js

Last post 03-12-2009 12:54 PM by rondata. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 03-11-2009 5:02 PM

    OS 0.8: newFetchPeopleRequest creates produces errors in myopenspace.v08.155.js

    I've been working on switching our application over to use OS 0.8, and I've run into an error with sending fetchPeopleRequests. I observe it in every browser I've tested -- FF3, IE7.

    Specifically: after calling request.send(callback), I see the following:

    1. A GET request to the MySpace API with a JSON response of all requested friend data.
    2. An javascript error in myopenspace.v08.155.js, specifically "D is null" (triggered by a call to D.id -- I can't really be more specific about the location of this since the js file is one line, which makes debugging a huge PITA).
    3. The callback does not get called.

    #3 makes me think that something is broken in the MyOpenSpace layer. Can anyone else repro this? Is there a known workaround?

    I've copied a portion of one of the "What's new in 0.8" examples (from here), and I repro this issue 100% of the time.

    Here's the slightly modified example code that I'm using:

    <script>
    <!--
    // create a request
    var testReq = opensocial.newDataRequest();

    // create the parameters for the idspec to send into the fetch app data request
    testParams = {};
    testParams[opensocial.IdSpec.Field.USER_ID] = opensocial.IdSpec.PersonId.VIEWER;
    testParams[opensocial.IdSpec.Field.NETWORK_DISTANCE] = 1;

    // create the idspec
    var testIdSpec = opensocial.newIdSpec(testParams);

    // add the fetch friend request to the queue
    testReq.add(testReq.newFetchPeopleRequest(testIdSpec), "friends");

    var testCallback = function(response) {
    $('fetch_test').innerHTML = 'responded with error? (' + response.hadError() + ') and error message: ' + response.getErrorMessage();
    }
    testReq.send(testCallback);
    // -->
    </script>
    <div id="fetch_test"></div>
  • 03-11-2009 5:28 PM In reply to

    Re: OS 0.8: newFetchPeopleRequest creates produces errors in myopenspace.v08.155.js

     Can you point me to a few of the other threads? Thanks!

  • 03-12-2009 4:29 AM In reply to

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

    Re: OS 0.8: newFetchPeopleRequest creates produces errors in myopenspace.v08.155.js

    Brendan, this thread for example with the similar bug reports from several developers: http://developer.myspace.com/Community/forums/t/6335.aspx?PageIndex=2
  • 03-12-2009 11:14 AM In reply to

    Re: OS 0.8: newFetchPeopleRequest creates produces errors in myopenspace.v08.155.js

     Huh, I see that my report has been merged into the one that you linked to (this thread).  I did search around for FetchPeopleRequest issues and even read through this thread -- but I decided not to post here or in any of the other threads I read because my problem appears to be totally different.

    People in this thread are having issues with pagination & the number of people returned, or they are seeing errors in their responses when they shouldn't get errors.  My problem exists apart from pagination issues, as far as I can tell.

    Every request I make results in a javascript error in the MyOpenSpace layer.  I never even get a response object on which I could call hadError(), getErrorMessage(), etc.  My callback never even gets hit.  It's just "D is null".  Boo :(

  • 03-12-2009 12:20 PM In reply to

    Re: OS 0.8: newFetchPeopleRequest creates produces errors in myopenspace.v08.155.js

    Sorry I was on a merging frenzy this AM, it's really hard to track issues that are posted all over the map. 

    FWIW, whenever you see a thread that is 4 pages long, chances are other things similar get merged to the end. Just because the title doesn't change, doesn't mean the content doesn't change, in other words - I believe on page 3/4 someone pointed out this issue at the end of the thread. 

    I always go to the end of long threads to make sure we stay current with the topic at hand.

    I realize you think these issues are different and I will send yours to qa separate, but if it's the same, you have to understand that I don't have the bandwidth to chase down and update every thread posted on a subject. It's easier for me to update just one.

    Thanks

     

  • 03-12-2009 12:29 PM In reply to

    Re: OS 0.8: newFetchPeopleRequest creates produces errors in myopenspace.v08.155.js

    Hey, it's totally OK -- they do appear to be linked on the surface.

    But good news:

    I figured out the root cause of my issue.  It's a workaround for an OpenSocial bug on Orkut.

    On Orkut, the Prototype library confliced with the opensocial utils in such a way that they recommended disabling a portion of Prototype like so:

    Array.prototype.toJSON = null;

    It appears that this workaround breaks the MyOpenSpace javascript (but not in 0.7), presumably because it relies on Prototype's toJSON functionality. Removing it has removed my "D is null" issue.  Thanks for triaging this anyway, hopefully any other developers with applications that share code across containers will find this helpful.

  • 03-12-2009 12:54 PM In reply to

    Re: OS 0.8: newFetchPeopleRequest creates produces errors in myopenspace.v08.155.js

     Oh good to know, thanks for that info :)

Page 1 of 1 (7 items)