CloudKit operations using publicDatabase queue unreliable

CloudKit CKOperations do not complete when on cellular. When they do its once in a blue moon.


I schedule things with allow cellular, and have verified in settings that iCloud allows cellular access. When I add any operation to the public database it will not do anything until I flip my device to wifi. This isn't acceptable as it is taking advantage of the location queries and is an on the go application.


Has anyone come up with a workaround? Other posts suggest that it is a reported buy but has been around for a while so I'm not entirely sure.


Edit:


I have unit tests setup to do everything not only my application. When I run my unit tests with wifi off, they fail (30 second timeout without callback). After running them a few times with wifi (passing) and then switching they all of a sudden work on cellular (4 for 4 runs).


I was able to run the app immediately after the successful cellular unit tests once. Its now back to failure.

What about this?

operation.qualityOfService = .UserInitiated

or

operation.qualityOfService = .UserInteractive

I have mixed and matched both queue priority and operation priority. User initiated, user interactive, high and very high priority do not help. My same query in development server worked fine with iOS 8 on the same device.

For me it seems to be stable over 3G when qualityOfService and iCloud Drive settings are set properly.

I also set operation priority "VeryHigh".


I'll continue checking it.

I had success with a few of the CKOperations on the default CKContainer. All CKDatabaseOperations that I have tried have had cellular issues.


The private database returned for me a few times with records after switching wifi off. I'm going to update my phone to 9.1 beta 5 and hope for the best. My other phone doesn't have a cellular phone and has been my primary development device.


I have submitted a bug on this and hope Apple takes care of it in 9.0.x. Public database queries/fetches on cellular seem to be a critical part of CloudKit. Expecially those taking advantage of locational queries while on the go!

I'm still having this issue in 2021. Did anybody manage to resolve? I have posted my comment on Stack here:
https://stackoverflow.com/questions/32493698/ios-9-cloudkit-query-does-not-return-anything-while-connected-to-cellular-netwo

I seem to recall that setting sort descriptors in the request flow made things work. Give that a try--it has been so long I don't for sure remember what I did to overcome the issue.
CloudKit operations using publicDatabase queue unreliable
 
 
Q