We use the Box node sdk to upload files whenever a file arrives in one of our S3 buckets. As part of the upload, we first create a desired folder structure per upload to Box by creating any folders that don't exist (according to folder name) in the desired folderpath. I recently discovered that when there are concurrent uploads whose desired folderpaths are similar, there's a race condition and as a consequence, sibling folders with the same name are created.
I'd prefer not to serialize my requests to Box, unless there's some support in the sdk for queuing. I searched these forums for any advice about post-processing to merge such folders, or avoid creating duplicates, but found none.
Can you recommend a best practice?