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:
- A GET request to the MySpace API with a JSON response of all requested friend data.
- 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).
- 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>