The flow is sending the same message/image twice to me

Hi
Can someone guide/help me, with this flow.
It working fine, but I get every message/image two times.
How can I fix it, so it only send the same message/image one time?

[{"id":"ad6ed13d6cc36211","type":"comment","z":"995c2b07aab109ad","name":"Telegr - Pastebin.com

Where in your flow does the repeat message appear?

It's when it send the message by Telegram, then I get two message on my telegram app, with less than 1 sec. between the messages. So can't see where the "repeat message appear" in the code/flow, but I get two messages on my Telegram App, from each "single/diffrent" message/image.

Add a debug node showing what is going into the telegram node and see what it shows.

Hi Colin
When I do that I get these two...
img1
img2

I have tried to changes the "inject node" to 8sec. if the issue was that it didn't deleted the image from my mail folder "NVR" within 5sec. before it read the folder again, but then I still get two messages of the same image.

So there are already two messages, so it is not telegram that is the problem.
So now use debug nodes to work back through the flow and find where the second message is coming from.

Hi again
Ok, I get the two of the same message from my "Get Mail".
And have tried trigger the node every 5 or 8 sec. i don't know if 10 og 12 sec. will help, but im thinking that is a long wait, before the trigger starte again.

Is there a node I can place after the "Get-Mail" node, that can:

  • If received first time, then send message one way. (use flow as now)
  • If already received, then send message another way. (end as do nothing/Blind way)

As you or other can see, I get the unik message "[GarageSkur] has detected a person DATE/TIME"
Or "[GarageHave] has detected a person DATE/TIME" these two can't be duplicated with two different pictures, it will be unik from message to message.

You can use a Filter node to ignore messages where the payload is the same as the previous message.

It happens to me sometimes...
I don't know exactly why, but if you a full deploy or fully restart NR, then it is "solved".

I suspect the reason is that the email server has not got round to deleting the previous message when asked again, so it sends it again.

Well, not in my case. It is "just" messages to telegram. An after a while, I may receive 2 or 3 of them...

That is a different issue to that described here then.

Hopefully that is your own local server - otherwise hitting it every 5 secs looks more like a DDoS to me :slight_smile: If I saw someone doing that to one of my servers they would get blocked.

Yes but possibly related. I suspect it has to do with how the "originating node" (email in the OP's case) is written because I get the same unwanted behavior with the the node-red-contrib-lutron Status node.

When there is a change on the editor tab where one of these nodes is used I start getting multiple copies of messages from the Status node even if it's flow/sequence/whateveryoucallit was not edited. Every Deploy adds another copy of the messages until a Full Deploy is done and then it goes back to the expected behavior.

That is a bug in that node then, it is not properly closing down when the node is restarted.

It is not my own server and the imap connection I use is allowed to make requests every 5 seconds. so a little irrelevant in this context, but thanks for the input.
And to be a DDos attack, it's not only a request from one IP every 5 sec., but from multiple IP's at once.

Node in "Lower" case, diden't fix the issue, aswell with the "Full Deploy" of the flow.
But thanks for the input, it might give a fix.
Just want to play with the trigger time, possibly. between 10-15 sec.
Otherwise, I will probably look at the "Filter" node.

I will try to play a bit with the trigger time and otherwise look at it with the "Filter" node.
But exciting input has come, but have looked at it with "UPPER" case on the name for my node, as well as tried to run a Full Deploy of my entire flow environment and nothing has changed.

Have tried that, as well as restarted the whole NR.
Also ran my flow, on other installed NR environments/machines and I experience the same error.

So either it is something in my flow, or it is because (as mentioned and others also wrote) that the message that is sent is not deleted within the 5 seconds. and that it is therefore sent again, (tried for 8 seconds and it is the same error.)

@Colin @LosinIt @greengolfer AND Others :slight_smile:

Thx...
OK... let me try to explain this but very strange.
Well, I have changed my "inject" node, from 5sec. up to 59 sec. (5,10,15,30,45,59) and all fail, i.e. it retrieves the image twice, the first time and then later again depending on what the "inject" node is set to.
It must be a bug with Node itself "node-red-node-email".
Because if I use an "Inject" node with timestamp or with repeat, it will run it twice before it deletes the files from the simply.com server (perhaps it could be their server that fails on the first call, but does not experience errors, when I delete emails via outlook etc. they are deleted the first time.
Tried for "Get Mail" itself to set it to "automatic" and then 10 sec. so it is not triggered via an inject node and it is the same issue, it sends each unique image twice and not just once.
Think that the "Filter node" should be tried.

Very strange though, or is it just me?