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 remounted as a shared folder in the root namespace (depending on the team settings). This can lead to strange error messages when attempting to make API calls that create or upload any children to this folder.
The below example discusses the behaviour when attempting to create two folders `/parent` and `/parent/child` successively with `files/create_folder` calls. Depending on the timing of the second API call, I've so far seen four different outcomes (sorted by increasing delay):
- The child is created immediately after creating the top-level parent, before remounting. This succeeds without errors.
- The child is created during remounting. This can cause a WriteError (conflict) when attempting to create the parent directory. This looks like a race condition to me: the parent directory temporarily does not exist, the Dropbox backend therefore attempts to create it and then raises a conflict because it has been remounted in the meantime.
- The child is created immediately after remounting. This causes a WriteError (no_write_permission) if the shared folder does not yet have correctly set permissions.
- The child is created with a larger delay. It is properly created in the now remounted shared folder.
Is there any recommendation for how to handle creating such nested structures in Team Spaces using the regular user endpoints from a non-admin account? And how much of the above is just expected behaviour that API clients just need to deal with?