Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stream functions hang if oauth config is invalid #81

Open
jlarigakis opened this issue Jun 21, 2017 · 1 comment
Open

Stream functions hang if oauth config is invalid #81

jlarigakis opened this issue Jun 21, 2017 · 1 comment

Comments

@jlarigakis
Copy link

jlarigakis commented Jun 21, 2017

To reproduce

Without setting the environment variables $TWITTER_ACCESS_TOKEN etc, run iex -S mix and call
ExTwitter.stream_sample |> Enum.to_list
(Or set the environment variables to invalid values, or invalidate your credentials using the web interface, etc.)

Expected behaviour

The call fails immediately, logging or returning an auth error

Observed behaviour

The call does nothing for several seconds, then eventually times out without displaying an error.

@parroty
Copy link
Owner

parroty commented Aug 22, 2017

Thanks for reporting the issue and sorry not being responsive. I've tried to fix the behavior as above.

incorrect authorization parameters

Interactive Elixir (1.5.0) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> ExTwitter.stream_sample |> Enum.take(3) |> Enum.to_list |> Enum.map(fn(x) -> x.text end)

22:44:23.663 [error] Error returned, stopping stream (Authorization Required).
[]

correct authorization parameters

Interactive Elixir (1.5.0) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> ExTwitter.stream_sample |> Enum.take(3) |> Enum.to_list |> Enum.map(fn(x) -> x.text end)
["RT @ChiyoFather: SideM 3rd Live 仙台 1日、2日目出演者公開 https://t.co/R6XYxJ3cPw",
 "RT @sidelust: Me talking to my family:\n\n▶ 🔘──────── 00:02\n\nMe talking to boys: \n\n▶ 🔘──────── 00:08\n\nMe talking to my dog:\n\n▶ 🔘──────── 1:54…",
 "RT @sateco: ハゲっていつの間に経営戦略研究科の客員教授になったのwwwwwww"]

parroty added a commit that referenced this issue Aug 22, 2017
Immediately stop stream when oauth config is invalid (#81)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants