huuanh1987 / facebook-java-api

Automatically exported from code.google.com/p/facebook-java-api
0 stars 0 forks source link

batched notifications_send return value wrong or outdated? #143

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. call beginBatch 
2. call notifications_send separately on 2-3 different users
3. call executeBatch

What is the expected output? What do you see instead?

im not sure what is expected.  from the fb documentation, 
notifications.send is supposed to return the list of ids that were 
successfully sent.  yet in your ExtensibleClient notifications_send returns 
void.  (i cant remember if i read something somewhere that said return 
values from notifications.send would be deprecated, which would explain 
this.)  anyways whats happening here is that inside 
FacebookJsonRestClient::executeBatch(), the return value from batch_run() 
is in the form of: 

[ "23432234", "2342342", ""]

where the empty string seems to represent an id that was passed in, but for 
which a notification wasnt sent, for various reasons like privacy settings.

the return "type" of the function seems to be "default", so executeBatch is 
trying to parse the return as an array of JSONObjects or JSONArrays, but 
the format doesn't exactly match that which is expected by the JSONObject 
or JSONArray constructor.  i think the format that is expected is something 
like:

[ {"23432234"}, {"2342342"}, {""} ]  as an array of JSONObjects, or
[ ["23432234"], ["2342342"], [""] ]  as an array of singleton JSONArrays

maybe this is a bug on facebook's end, or are we not capturing fb's output 
correctly?

What version of the product are you using? On what operating system?
the latest stable version 2.0.2, on winXP, eclipse, java 1.5

Please provide any additional information below.

Original issue reported on code.google.com by thien.p....@gmail.com on 24 Nov 2008 at 10:13

GoogleCodeExporter commented 8 years ago
Also, looking at the static setup code for return types in 
FacebookJsonRestClient, I 
noticed that it’s picking the return type from this method, which is 
deprecated:

      public URL notifications_send( Collection<Long> recipientIds, CharSequence 
notification, CharSequence email ) throws FacebookException, IOException {

instead of this one:

      public void notifications_send( Collection<Long> recipientIds, CharSequence 
notification ) throws FacebookException, IOException {

At the end of the day, looks like you’re just treating URL return type as 
“default”, 
so not sure that matters…

Original comment by thien.p....@gmail.com on 24 Nov 2008 at 10:31

GoogleCodeExporter commented 8 years ago
deprecated method will go away anyhow

Original comment by fern...@gmail.com on 29 Oct 2009 at 11:57