# Twitter Node delivers twice

**URL:** <https://discourse.nodered.org/t/twitter-node-delivers-twice/2454>\
**Category:** General\
**Created:** [21 August 2018 21:54 UTC](https://discourse.nodered.org/t/twitter-node-delivers-twice/2454 "2018-08-21T21:54:12Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![CaptClaude](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/captclaude/32/2125_2.png) [@CaptClaude](https://discourse.nodered.org/u/CaptClaude)\
**Post date:** [21 August 2018 21:54 UTC](https://discourse.nodered.org/t/twitter-node-delivers-twice/2454/1 "2018-08-21T21:54:12Z")

</div>

I have a NR Twitter node that looks for "cheerlights", no "@", no "#". I'm now getting two outputs in the debug node, 1s apart, with the same information except for the first line (time stamp) and last line (msg id). What could be causing this?

[Edit] If my "For" is #cheerlights as well as what I said above, I still get the same result: 2x information. [\Edit]

> 8/21/2018, 11:15:15 AMnode: fd2ca948.4c11f8  
> tweets/Smartirrigatio2 : msg : Object  
> object  
> topic: "tweets/Smartirrigatio2"  
> payload: "2018-08-21 6:15 pm and CheerLights is .”"  
> lang: "en"  
> tweet: object  
> created\_at: "Tue Aug 21 16:15:15 +0000 2018"  
> id: 1031937786419527700  
> id\_str: "1031937786419527680"  
> text: "2018-08-21 6:15 pm and CheerLights is .”"  
> source: "[ThingTweet](https://thingspeak.com/apps/thingtweet)"  
> truncated: false  
> in\_reply\_to\_status\_id: null  
> in\_reply\_to\_status\_id\_str: null  
> in\_reply\_to\_user\_id: null  
> in\_reply\_to\_user\_id\_str: null  
> in\_reply\_to\_screen\_name: null  
> user: object  
> geo: null  
> coordinates: null  
> place: null  
> contributors: null  
> is\_quote\_status: false  
> quote\_count: 0  
> reply\_count: 0  
> retweet\_count: 0  
> favorite\_count: 0  
> entities: object  
> favorited: false  
> retweeted: false  
> filter\_level: "low"  
> lang: "en"  
> timestamp\_ms: "1534868115416"  
> \_msgid: "c2bc9f6b.613c3"
> 
> 8/21/2018, 11:15:16 AMnode: fd2ca948.4c11f8  
> tweets/Smartirrigatio2 : msg : Object  
> object  
> topic: "tweets/Smartirrigatio2"  
> payload: "2018-08-21 6:15 pm and CheerLights is .”"  
> lang: "en"  
> tweet: object  
> created\_at: "Tue Aug 21 16:15:15 +0000 2018"  
> id: 1031937786419527700  
> id\_str: "1031937786419527680"  
> text: "2018-08-21 6:15 pm and CheerLights is .”"  
> source: "[ThingTweet](https://thingspeak.com/apps/thingtweet)"  
> truncated: false  
> in\_reply\_to\_status\_id: null  
> in\_reply\_to\_status\_id\_str: null  
> in\_reply\_to\_user\_id: null  
> in\_reply\_to\_user\_id\_str: null  
> in\_reply\_to\_screen\_name: null  
> user: object  
> geo: null  
> coordinates: null  
> place: null  
> contributors: null  
> is\_quote\_status: false  
> quote\_count: 0  
> reply\_count: 0  
> retweet\_count: 0  
> favorite\_count: 0  
> entities: object  
> favorited: false  
> retweeted: false  
> filter\_level: "low"  
> lang: "en"  
> timestamp\_ms: "1534868115416"  
> \_msgid: "5df4d4c6.04bdbc"

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [21 August 2018 22:40 UTC](https://discourse.nodered.org/t/twitter-node-delivers-twice/2454/2 "2018-08-21T22:40:48Z")

</div>

What version of the Twitter node are you using? Due to the API changes Twitter introduced last week, the node went through a huge rewrite.

I'll see if I can reproduce.

---

<div class="post-metadata">

**Author:** ![CaptClaude](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/captclaude/32/2125_2.png) [@CaptClaude](https://discourse.nodered.org/u/CaptClaude)\
**Post date:** [22 August 2018 05:19 UTC](https://discourse.nodered.org/t/twitter-node-delivers-twice/2454/3 "2018-08-22T05:19:11Z")

</div>

I saw your post about the need to update to the newest everything and did so, but who knows if I got everything right. Briefly:

> # jm:.node-red jm$ node-red -v 22 Aug 00:10:53 - [info] Welcome to Node-RED
> 
> 22 Aug 00:10:53 - [info] Node-RED version: v0.19.1  
> 22 Aug 00:10:53 - [info] Node.js version: v6.11.4  
> 22 Aug 00:10:53 - [info] Darwin 16.7.0 x64 LE

And:

> jm:.node-red jm$ node-red-admin list  
> -bash: node-red-admin: command not found  
> jm:.node-red jm$ npm ls -g node-red-node-twitter  
> /usr/local/lib  
> ├─┬ node-red@0.19.1  
> │ └── node-red-node-twitter@1.1.2  
> └── node-red-node-twitter@1.1.2  
> jm:.node-red jm$

Based on that, I think I'm at the most recent version of NR and the Twitter node.

---

<div class="post-metadata">

**Author:** ![CaptClaude](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/captclaude/32/2125_2.png) [@CaptClaude](https://discourse.nodered.org/u/CaptClaude)\
**Post date:** [28 August 2018 17:37 UTC](https://discourse.nodered.org/t/twitter-node-delivers-twice/2454/4 "2018-08-28T17:37:07Z")

</div>

Bump.  
Not sure whether to interpret the quiet here as "We all have more important things to do" (which would be completely understandable) or "We don't see this, it must be something in your setup". Or something else.  
Anybody else seeing this? If not, it must be me.  
Thanks.

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [28 August 2018 18:51 UTC](https://discourse.nodered.org/t/twitter-node-delivers-twice/2454/5 "2018-08-28T18:51:14Z")

</div>

Sorry - I didn't pay attention to your plight ☹

I get exactly the same result as you

2 Node-RED messages for every cheerlights tweet

I'm on v1.1.2 and NR 0.19.2 (standard Pi upgraded setup)

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [28 August 2018 19:31 UTC](https://discourse.nodered.org/t/twitter-node-delivers-twice/2454/6 "2018-08-28T19:31:11Z")

</div>

Hi @CaptClaude

I did manage to recreate it at the end of last week, although I'm not sure how. I was then away for the weekend so forgot to follow up with you. I suspect the stream connection is hitting an error and starting a new stream... but the old stream is still receiving. So a restart of Node-RED will stop the duplicates (as it'll clean up the old streams).

Annoyingly, this is the one part of the node that didn't get completely rewritten - so I'm not sure why its behaviour would have changed.

Given it took a couple days of running (on and off whilst I'm busy developing other things), I can't say when a fix will be available. If anyone else wanted to dive in, it would certainly help.

Nick

---

<div class="post-metadata">

**Author:** ![CaptClaude](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/captclaude/32/2125_2.png) [@CaptClaude](https://discourse.nodered.org/u/CaptClaude)\
**Post date:** [28 August 2018 22:21 UTC](https://discourse.nodered.org/t/twitter-node-delivers-twice/2454/7 "2018-08-28T22:21:26Z")

</div>

Nick, thanks for taking a look. And Simon for verifying.  
There is comfort in knowing it's not just me. 😄  
And as I am playing with Cheerlights using @cymplecy's feed (for my ESP8266-based thingies) as well as using MQTTBox to get a feel for what the various streams actually deliver, there is **no rush** to fix this.  
You do **not** want me diving in: I don't speak enough JavaScript to order a beer or find the loo. I do this for fun and education and to keep myself out of the asylum.  
Thanks,  
--Jeff

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [29 August 2018 07:11 UTC](https://discourse.nodered.org/t/twitter-node-delivers-twice/2454/8 "2018-08-29T07:11:01Z")

</div>

And in the meantime, a simple workaround is to add an RBE node after the Twitter node to filter out duplicate messages

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/3/3b182a5f1d3adc21bd66e866277d1155169389f2.png)

---

<div class="post-metadata">

**Author:** ![CaptClaude](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/captclaude/32/2125_2.png) [@CaptClaude](https://discourse.nodered.org/u/CaptClaude)\
**Post date:** [20 September 2018 16:03 UTC](https://discourse.nodered.org/t/twitter-node-delivers-twice/2454/9 "2018-09-20T16:03:58Z")

</div>

I just got back to this and in the process had NR stop on me. When I restarted it (probably for the first time in a long while, all the strange errors stopped.

> [@knolleary](#):
>
> I suspect the stream connection is hitting an error and starting a new stream

That explains all the strange stream-related errors I was getting. I'm in no rush for a fix as no lives depend on it. It's a cold, rainy day here so I'm playing again. Thanks.
