I have two apps that use App Groups, CloudKit and Core Data for sharing data between multiple devices and users (one is a sample for the issue, the other one the full fledged one).
In the sample app I have the following model: Collection (name) -> many Items (names and count) and corresponding views to increment the count.
I also have the widget share the proper App Group and CloudKit container. It has a button that triggers an increment app intent.
A create a shared collection "Shares" and add two items in it - "A" & "B".
Sharing from the applications and updates of the count takes about 2 seconds. I.e. I open the item view and I tap an increment button, the second phone screen updates almost immediately. Upon each update I also call WidgetCenter.shared.reloadAllTimelines().
What I see is that widgets have are not in sync with the data of the app. I have an explicit button to trigger the reload of the timelines, I can follow along with the debugger and the Core Data data is different, i.e. different count. I also show a date property, so I know that the widget is redrawn.
I think that as soon as I added the target for the widget and added it to the app group I started seeing: BUG IN CLOUDKIT: Error submitting background task request: Error Domain=BGSystemTaskSchedulerErrorDomain Code=3 "(null)". The sync between the widget and the app on the same device is inconsistent.
I also see a lot of when interactions happen fast.
submitTaskRequest failed for com.apple.coredata.cloudkit.activity.import.
submitTaskRequest failed for com.apple.coredata.cloudkit.activity.export.
I least I hope is that after the app has synchronised, the widget will catch-up and show the same data - i.e. at least the same device will show data consistently. This does not happen though. Even on the device on which I'm doing the changes, and tapping multiple times the manual reload of widgets button, the Core Data is stale, and the time of reload of the widget is fine.
The relevant threads this I've found are (none of them can shed any light):
https://developer.apple.com/forums/thread/653112?answerId=697974022
https://developer.apple.com/forums/thread/650192?answerId=614112022#614112022
https://developer.apple.com/forums/thread/651648?answerId=827386022
I have tested with iOS 26.5.2 and iOS 27 Beta.
The widget is it out sync
2
0
62