n8n icon indicating copy to clipboard operation
n8n copied to clipboard

GMAIL-Trigger fires every minute with the latest email

Open paulwer opened this issue 2 years ago • 14 comments
trafficstars

Describe the bug GMAIL-Trigger fires every minute with the latest email To Reproduce Use the trigger with refresh-time one-minute

Expected behavior only fetch emails once / remove option for users to select this.

Environment (please complete the following information):

  • n8n Version 0.216.0

paulwer avatar Feb 19 '23 19:02 paulwer

Hey @paulwer,

I have just set up a simple trigger using the GMail node with a 1 minute interval set, I will report back in 10 minutes with the findings.

Joffcom avatar Feb 20 '23 10:02 Joffcom

Hey @paulwer,

Testing results are in... I have only have 2 runs. The first one was a manual execution and the second was a well timed message from a recruiter on LinkedIn.

image

Not sure why I am not seeing the same thing, I guess looking at the report I should have an execution every minute with the LinkedIn message in it.

Is there maybe more to this? What settings do you have enabled in the node? This is what I have been using.

image

Joffcom avatar Feb 20 '23 10:02 Joffcom

@Joffcom https://drive.google.com/file/d/1kqDkaaJDeEDwZzY_F2K5RE-ByhAK_XMo/view?usp=share_link Edit: Video quality is still trash, pls, wait a couple minutes, until drive as procesed it or download it

It not happens all the time. right now its working, but yesterday there were many executions, which does have duplicates. I currently save the id to a database, to prevent duplicates within my flow.

This issue caused an exhessive call of a payed api (mindee) within the last days in my case.

paulwer avatar Feb 20 '23 11:02 paulwer

@Joffcom i am downloading the attachements. wild guess: maybe this causes a long executiontime and therefore overlaps with the next execution?

Unbenannt

Edit: according to the code, this could realy be possible. Maybe the webhook_data should be updated right after the first fetch of all messages. I assume, binary data is downloaded later within the for-loop. Please check and verify if this is a thing?

paulwer avatar Feb 20 '23 11:02 paulwer

Hey @paulwer,

I think we base the fetching on the current date / time so when the node runs it would be something like lastRunTime - 1 minute we then check the inbox for anything with a time that matches that. Looking at the video though I did notice that the email Date field was Invalid DateTime so I am just doing another test with Simplify Disabled to see if that changes anything.

Will be back in 10 minutes.

Joffcom avatar Feb 20 '23 11:02 Joffcom

Quick update... It wasn't that 🤔 Time to try with an attachment.

Joffcom avatar Feb 20 '23 11:02 Joffcom

Alright, Last update before lunch...

With file downloading it is all good as well 🤔 will think of more tests to try and reproduce it.

Joffcom avatar Feb 20 '23 12:02 Joffcom

thank you very much, i am here, if you need me anything to try or for questions. :)

paulwer avatar Feb 20 '23 12:02 paulwer

@Joffcom should i forward you a mail, which has caused this in my case?

paulwer avatar Feb 20 '23 12:02 paulwer

Hey @paulwer,

Oddly enough I got back from lunch and there was a newsletter that came in and I have 13 executions for it, Now I have seen it I just need to find a way to force it to happen so that we can work out how to fix it.

Joffcom avatar Feb 20 '23 14:02 Joffcom

Afternoon @paulwer,

Just checked my workflow and it has happened again but this time I didn't have the download option set. It was also an email from Costco so no real pattern there yet.

I have created an internal ticket for this one though which we will be tracking as NODE-320.

Joffcom avatar Feb 21 '23 14:02 Joffcom

Thanks for the information. Looking forward for next informations. Have a nice day.

paulwer avatar Feb 21 '23 15:02 paulwer

Oddly enough I was just testing another issue and an email from Costco has again appeared multiple times, I am starting to thing this is related to specific email senders or properties.

Joffcom avatar Jun 29 '23 15:06 Joffcom

Fix got released with [email protected]

janober avatar May 22 '24 16:05 janober