API.stream.publish - uid long not int - bug!

Aug 26, 2009 at 4:33 AM
Edited Aug 26, 2009 at 4:35 AM

Calling the following

 

API.stream.publish(stringMessage, attachment, null, _fbService.uid.ToString(), Convert.ToInt32(API.uid.ToString()));

The publish API has (string, attachment, IList<action_link>, string, int uid)

The API.uid is a long not an int.  Why is the API representing an int? 

converting the UID long to an int causes an Overflow exception by user code "Value was either too large or too small for an Int32."

Is this a known issue or is the above code example of Convert.ToInt32 wrong?  

Has this been fixed?

Aug 26, 2009 at 4:52 AM

I changed all method calls in the stream class to use long for uid instead of int.  Facebook apparently changed out the UID to be long.  

 

_fbService.API.stream.publish(stringMessage, attachment, null, _fbService.uid.ToString(), _fbService.uid);

Recompiled and bingo!

With this change the stream method is now working! Gotta love opensource code! :-)

 

 

Oct 22, 2009 at 5:42 AM

Plandis is correct, as I too confirmed this fix....

In the case of stream.publish in the current release, I changed the signature on the following function to use a long instead of an int:

Before:
public string publish(string message, attachment attachment, IList<action_link> action_links, string target_id, int uid)

After:
public string publish(string message, attachment attachment, IList<action_link> action_links, string target_id, long uid)

Then I recompiled and everything fired up, as I was able to publish streams using the longer user ids.

I would imagine this will be addressed in the next release.

Thanks,
Josh

 

 

Oct 22, 2009 at 3:29 PM

You could also get the 3.0 source, which has uid as long throughout, and seems fairly stable from what I've seen in my dev environment