tweetstream / em-twitter

Twitter Streaming API client for EventMachine
http://rubygems.org/gems/em-twitter
MIT License
42 stars 16 forks source link

Simple_OAuth error #19

Closed auxbuss closed 10 years ago

auxbuss commented 10 years ago

I just ran into the same problem describe here: https://github.com/Yelp/yelp-ruby/issues/21

I get:

SimpleOAuth: Found extra option keys not matching ATTRIBUTE_KEYS: [:consumer_secret, :token_secret] 

There's some background to the simple_oauth change here: https://github.com/laserlemon/simple_oauth/pull/17

auxbuss commented 10 years ago

simple_oauth introduces an override option for this check: :ignore_extra_keys

So the simplest might be to add this somewere in EventMachine::Twitter::Request.initialize(options = {})

stve commented 10 years ago

awesome, thanks for looking into that. I'll have a fresh release out today with a fix

stve commented 10 years ago

just release 0.3.4 which includes the fix

auxbuss commented 10 years ago

This doesn't work for me. It now fails to connect:

[ 2014-10-31 09:46:05 UTC -- INFO ] (userstream): *** Starting: mode: production
[ 2014-10-31 09:46:05 UTC -- INFO ] (userstream): reconnect. timeout: 10, retries: 0
[ 2014-10-31 09:46:15 UTC -- INFO ] (userstream): reconnect. timeout: 20, retries: 1
[ 2014-10-31 09:46:35 UTC -- INFO ] (userstream): reconnect. timeout: 40, retries: 2
[ 2014-10-31 09:47:16 UTC -- INFO ] (userstream): reconnect. timeout: 80, retries: 3
[ 2014-10-31 09:48:36 UTC -- INFO ] (userstream): reconnect. timeout: 160, retries: 4
[ 2014-10-31 09:51:16 UTC -- INFO ] (userstream): reconnect. timeout: 320, retries: 5

This is logged via:

stream.on_reconnect do |timeout, retries|
  @logger.info "reconnect. timeout: #{timeout}, retries: #{retries}"
end

Here's what I've tried:

Working system:

em-twitter (0.3.3)
simple_oauth (0.2.0)
twitter (5.11.0)

Let everything update, then:

em-twitter (0.3.4)
simple_oauth (0.3.0)
twitter (5.12.0)

Fails to connect.

Hold simple_oauth

em-twitter (0.3.4)
simple_oauth (0.2.0)
twitter (5.11.0)

Fails to connect.

Hold twitter

em-twitter (0.3.4)
simple_oauth (0.2.0)
twitter (5.11.0)

Same as previous case.

stve commented 10 years ago

Would you mind giving 0.3.5 a try? I got too cute with my fix and didn't pass in the secrets so the oauth header that got generated didn't work. I've been able to stream with 0.3.5 and simple_oauth 0.3.0 consistently now.

auxbuss commented 10 years ago

\o/ That's working fine here. Thanks.