How to detect newly added files ?

This issue : 5541 has been closed by this commit

From now on, what is the best reliable way, polling the /events REST API endpoints to understand/infer that some file or folder has been added “for the first time” to a folder ?

As I understand there will be no more distinction between “first addition” and “modified since first addition”. I know that there were bugs in the past (one deleted filename added again on the same path was not considered as added), but in my use case I was listening to LocalChangeDetected and RemoteChangeDetected added actions to trigger notifications, which worked 99.9% of the time… and is a big part of my sync workflow…

As an example, imagine a dropbox-like subfolder where people drop content and other people get notifications about those additions.

1 Like

I think you need to keep the state yourself. When your thing starts up, look what files are already present. Notifications for files not present mean “added”, and then you remember those names as well. On delete, forget them. This also works around the issue with previously deleted files.

Thanks for your feedback, I will indeed use an external script to preserve this kind of state. One more question, in the release notes for the rc of 1.6 you wrote:

The LocalChangeDetected event no longer has the action set to added for new files, instead showing modified for all local file changes.

Is the omission of the RemoteChangeDetected event name intentional or did I not understand that the added action is only removed for LocalChangeDetected ?

As I understand the added is definitely removed for Remote and Local change file change notification events.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.