Hi all,
I'm using SwiftyDropbox in a Swift 3 app. I managed to get authentication working, I can get the details of the authenticated user, I can upload files, I can download files, I can create folders ... all is fine.
My app allows users to download map tiles. A map tile is a 256x256 image, and there is a folder structure containing zoom level, x and y coordinates, for example 1/1/1.png.
The app downloades these files from the web to local storage. The user can then choose to share these files to an external storage, like iCloud Drive, Dropbox, etc.
I get the odd API rate limit error when uploading these files to Dropbox.
I've tried re-uploading the failed files using the retry_after argument when the error occurs but I find there's no guarantee that the file will actually be uploaded that way.
I've also tried to implement a delay between the upload of every tile, but even a delay of 5 seconds between every upload causes API rate limit errors.
So I'm stuck in a situation where I have (for example) 100 files in various folders in local storage, and about 96 or so make it to Dropbox.
I'm slowly running out of ideas here. I find it very strange that a service like Dropbox produces API rate limit errors. This is 2017 and I'm trying to copy files to Dropbox, not launch a shuttle to Mars.
The only option left I can see is to make a zip bundle in the app's local storage, then upload that zip file to Dropbox. At least the upload is then limited to the one file.
I'd happily share code, but there's nothing but standard API calls in there like they're documented in SwiftyDropbox documentation.
Why is it that the API produces rate limit errors while at the same time I can drag the same folders to my Dropbox folder in Finder and the upload will just work?