3

Closed

Requestparameter duplication when requesting a stream

description

Hi Joe,

I noticed some strange behavior when requesting filter streams. Streams with a larger number of filter values (>20) result in an ArgumentException in TwitterExecute.GetBasicStreamRequest on line 655 due to duplicate requestparameters that can not be converted to a dictionary.

This description applies to WinRt and the ffbabcf9f7d3 commit.
I do a stream request like this:
                        stream = (from strm in twitterCtx.Streaming
                                  where strm.Type == StreamingType.Filter &&
                                      strm.Track == filter
                                  select strm)
                        .StreamingCallback(strm =>
                        {
                            // stream callback handling
                        })
                        .SingleOrDefault();
When stepping through the code I found that the request will always have it's requestparameters duplicated. This is the call sequence resulting in the duplication:

TwitterExecute.GetBasicStreamRequest
extracts a dictionary of postdata from request and calls OAuthAuthorizer.PostRequest with the request and postdata

OAuthAuthorizer.PostRequest
calls OAuthTwitter.GetOAuthQueryStringForPost

OAuthTwitter.GetOAuthQueryStringForPost
adds a dictionary of postdata to the request as requestparameters resulting in duplicate requestparameters

With longer filter values TwitterExecute.GetBasicStreamRequest is called a second time resulting in the mentioned exception.

regards,

Roland Smeenk
Closed Mar 21, 2013 at 3:43 AM by JoeMayo
Removed the code that was adding the extra parameters.

comments

grennis wrote Mar 20, 2013 at 5:21 PM

We ran into this also.