Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

🔗 Handle CloudKit throttles

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:

  • Minimize the number of CloudKit operations and avoid doing many operations in a short time frame.
  • Handle errors for every CloudKit operation. When hitting a .requestRateLimited or .serviceUnavailable error, retrieve the CKErrorRetryAfterKey value from the userInfo dictionary, and use it as the number of seconds to wait before retrying the operation.
  • For operations that are not critical for the current launch session, schedule them as background tasks using the BackgroundTasks framework to have the system run the operations when it determines appropriate.
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.

Log out of iCloud and log in again

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.

The post 🔗 Handle CloudKit throttles first appeared on @gurupanguji • Ramblings of an Eccentric Soul.



This post first appeared on Ramblings Of An Eccentric Soul... | Thoughts, Ramb, please read the originial post: here

Share the post

🔗 Handle CloudKit throttles

×

Subscribe to Ramblings Of An Eccentric Soul... | Thoughts, Ramb

Get updates delivered right to your inbox!

Thank you for your subscription

×