Problem statement and Impact:
When creating a new directory and specifying specific property at the creation command, it seems like if we have an event based replication and beforeDirectoryReplication block in a user plugin where this block triggers the replication only if we have this specific property on the folder, the property is not yet attached to the directory when calling the beforeDirectoryReplication block which causes the folder to not get replicated.
Steps to reproduce:
1. Configure event based replication for a local repo.
2. Configure the below user plugin:
This user plugin will trigger folder replication only if we have the foo=true property.
3. Create a folder with the "foo=true" property
You will notice that the folder has not been replicated and that it has been skipped, printing via the plugin the folders that have the property we get no results.
4. Create one more folder with the "foo=true" property:
We will skip again the replication of the new created folder, but now we will see that the previous directory from the previous creation command is in the list of the folders that have the property:
beforeDirectoryReplication is triggered before the property is attached to the directory. while the property has been mentioned in the directory creation command.
beforeDirectoryReplication should be triggered only after the property is attached to the directory. We mention in the wiki:
Description: Create new directory at the specified destination.
Notes: You can also attach properties as part of creating directories.
Run the replication manually again or wait until the cron expression is triggering the replication again.