We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
Sam S.6
5 years agoExplorer | Level 4
Possible race condition when creating in a folder in Team Spaces
When creating a top-level folder with the `files/create_folder` endpoint with a user account with Team Spaces, the folder appears to be created as a personal folder first and then converted and remou...
Sam S.6
5 years agoExplorer | Level 4
As an addendum, the same behaviour can be verified when retrieving the metadata for the `/parent` folder with `files/get_metadata` just after creation:
1. First, metadata for a personal folder is returned.
2. After a short delay, a LookupError is raised.
3. Finally, metadata with correct sharing info is returned.
Maybe creating folders in the Team Space should be done using the `sharing/share_folder` endpoint instead to avoid this unmounting and mounting? Alternatively, the Dropbox API could wait before returning from `/files/create_folder` until the folder is "properly" set up.
- Greg-DB5 years ago
Dropbox Community Moderator
Thanks for the detailed write-up! Yes, as you found, the Dropbox backend needs to perform some additional work immediately after a folder like this is created. There isn't a great way to check on this programmatically unfortunately, so please add a sufficient delay. I know this is non-ideal and can be slow, so I'll send this along as feedback to the team to see if we can improve or eliminate this in the future. Apologies for the bother!
- Sam S.65 years agoExplorer | Level 4
Ok, thanks for passing this on. I am using she `sharing/share_folder` endpoint for now when creating a folder in a Team Space. It's not ideal for creating folders because the error and conflict handling is geared towards sharing existing folders and is not particularly helpful in case of malformed paths and other "WriteError" scenarios. This endpoint does however create a Team Space folder "atomically", without unmounting and mounting or changing permissions. It's also slow, sometimes up to 25 sec to create a shared folder, but I've seen similar delays when waiting for the entire remounting process to complete.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!