-
Notifications
You must be signed in to change notification settings - Fork 35
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
Streams unreliable for collecting tweets from slow tweeting accounts #66
Comments
@rctgamer3 I've been listening to a stream filtered on an abandoned twitter account for the last 24 hours and it has experienced no issues. To look into this further could you provide either of the following:
Note that you may actually just be running into network weather closing your connection (hence the unresponsive error). Checkout this section of the readme to implement retry logic. |
Oh, sorry, forgot about this. I'll try to get you the requested information. |
This is code to reproduce:
And this is results:
First json when I posted tweet: https://twitter.com/PreciseLabPL/status/1407654882488823808 Next error some minutes after my tweet and next error some minutes after. There is connected topic: https://twittercommunity.com/t/filtered-stream-disconnects-every-5-minutes-on-nodejs/153866/7 My rules:
|
Third error after some next minutes (about 5) and in this time both PreciseLabPL and elonmusk did not send tweets. |
Every 20 sec there is send empty
then
is runned and because
but when in these 30 seconds twitter will not send empty message to "on.('data')" then we can observe this error: There is fragment from monitoring ( I added some console logs to this package ):
You can see that when error is thrown there difference between time of last
I observer two errors
I changed timeout from 30 sec to 120 sec and have this error again
My propositions 1 change name of error from
to
describe this error as lack of response from twitter.
Other events:Docs: https://nodejs.org/docs/latest-v16.x/api/stream.html Class: stream.Readable Class: stream.Writable I our case we should have readable stream: https://github.com/node-fetch/node-fetch#streams but we have writable It can be connected with pipe
but response is
|
There is connected issue: xdevplatform/Twitter-API-v2-sample-code#34 I finally suggest write in README that this package can be used ONLY with I confirming that
fixed problem. |
Prerequisites
following:
Description
The streams part of twitter-v2 is unreliable. I've set it to monitor five twitter accounts that tweet about once every six hours.
Steps to Reproduce
Expected behaviour:
Should be able to run indefinitely. twitter-v2 should not disconnect the stream just because it thinks the stream is unresponsive. The sample code by Twitter themselves does not have this behaviour.
Actual behaviour:
Streams randomly hit
this._closeWithError
.Stream timeout's, and throws a TwitterError that the stream is unresponsive.
Reproduces how often:
Always, the only variable is the time until it closes the stream.
Versions
1.0.8
Additional Information
If you need any further information to triage things, let me know.
The text was updated successfully, but these errors were encountered: