One Drive Sync - Library with Event Receiver issues?

Brass Contributor

I have an event receiver on some libraries that automatically sets a couple of fields based on the folder they are uploaded to. This gives me auto-tagging for my documents, but I'm suspicious that the event receiver that does this is tripping on the one drive sync client, which my user is using to do the uploads. 

 

What we're seeing, is that occasionally, a file will duplicate itself 2 or three times and append the user's computer name to the end. The first copies are always 0 kb in size, and don't open properly. Only the last document seems to work. I don't know if it's my event receiver, but I haven't seen this behavior anywhere else, and it's not 100% consistent here. He's an example of what I'm seeing:

My theory is that when the user uploads the document, the event receiver is updating it so fast that the client gets the changes mixed up, and can't merge the changes, so it does it's thing of keeping both files. But it does this all automatically, and I saw these files generated within seconds of the originals being uploaded.

 

Just wondering if anyone else has seen this behavior, if event receivers are just not the thing to use (I know I can set folder defaults, but that solution was not as scalable as event receivers, so I went with ERs), or maybe even using flow to set these defaults. 

Thanks!

 

1 Reply

Before debugging event receiver can you make sure to delete any cache files stored in Microsoft Upload Center that office on your computer uses to sync with Onedrive and repair Office version on User's PC.