n8n-io / n8n

Free and source-available fair-code licensed workflow automation tool. Easily automate tasks across different services.
https://n8n.io
Other
48.27k stars 7.48k forks source link

Google Drive Trigger not working when syncing through a desktop app #9772

Open mrcrdwd opened 4 months ago

mrcrdwd commented 4 months ago

Bug Description

When syncing / uploading files to Google Drive the createdTime and modifiedTime are preserved from the local filesystem. The problem is that the poll function in the Google Drive Trigger checks for these dates to determine whether or not new files have been added. I did a quick check if there is a different file property that does get updated to the current date but couldn't find one.

When uploading files through the web interface to Google Drive the createdTime is set to the current moment so the trigger does work correctly in that case.

To Reproduce

  1. Download the Google Drive app (on OSX)
  2. Create a synced folder (set to streaming)
  3. Add a file to the synced folder

Expected behavior

The n8n Google Drive Trigger should also fire when files are uploaded via a desktop app.

Operating System

Ubuntu 22.04.4 LTS

n8n Version

1.45.1

Node.js Version

v20.5.1

Database

SQLite (default)

Execution mode

main (default)

mrcrdwd commented 4 months ago

Apparently, there's a whole thread around how the Google Drive sync clients (don't) handle creation and modification dates.

A simple, though not very elegant workaround, is to rename a file on the local disk once it has been synced. That changes the modification date. Mind you that renaming the file first, before syncing, doesn't change the modification date. At least not on OSX.

The other workaround, as described above, is to upload the file through the web interface.

Joffcom commented 3 months ago

Hey @mrcrdwd,

Looking at this I am not sure if there is actually anything we can do without indexing the entire contents of the google drive to look for something new which wouldn't be ideal.

I will do some digging to see if I can find anything else for this but it could be that we are not able to fix this.