Removed and then re-added subfolder triggers "deleted" and then "modified" events

I’m currently playing with the events API

Removing one subfolder triggers the localChangeDetected event with data.action == 'deleted'

Re-adding a folder with same name triggers the localChangeDetected with data.action == 'modified'

Is this by design ? I would expect the key to be data.action == 'added'since the folder has been previously removed/deleted.

Ignores are not involved since I only ignore “garbage” files, there is no (.DS_Store,…).

See screenshot

Deleted entries are kept in the index, do I suspect it results in a modification because the deleted flag just gets set to false.

That’s what I suspected.

But it’s weird from the outside to understand that in some cases (folders with same names, not specially the same folders) the state can switch from deleted -to-> modified.

Couldn’it be better if it triggered readded, undeleted or added when the deleted flag gets set to false?

Sure, makes sense to have it emit added. File a PR if you care strongly about this.

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