1 min read

🔗 Handle CloudKit throttles

CloudKit throttles are particularly dense and confusing. The solution is often just wait, sadly.
Handle CloudKit throttles

CloudKit throttles are implemented to balance the use of CloudKit resources and achieve the best overall user experience of the service. When an app hits throttles, CloudKit stops accepting its requests until the throttles expire. There is no API for an app to configure the expiration time.

The best strategy to handle CloudKit throttles is to avoid them in the first place, and respect the retryAfter time if they happen. For apps that use the CloudKit framework, consider the following:

TN3162: Understanding CloudKit throttles | Apple Developer Documentation

I appreciate the intent behind CloudKit throttling. However, in most cases, especially when it's Apple apps - iCloud Drive - that's the culprit, there is no recourse but to wait an unspecified time. I strongly recommend a fourth bullet point:

  • Let the user know when they should expect the retry of sync.

My suspicion is that Apple might argue this is for the HCI guidelines and not for the CloudKit documentation. However, we all see why this could be included here given Apple themselves don't highlight the state / error / resolution timeframe to the user.

p.s. This suggests that the typically suggested resolution here: turn iCloud on/off has a higher likelihood to cause issues in this case than resolve the issue.

If you regularly experience sync problems with your iOS device(s) and you know your network is stable, then you should try logging out of your iCloud account on your iOS device or Mac, then log back in.

https://www.computerworld.com/article/2916476/how-to-fix-icloud-sync-in-seconds.html

On that note, this is a particularly unhelpful article.