I have developed an app that has a Widget that is updated daily at the user's midnight. The timeline will provide 3 entries, with a policy .atEnd:
Yesterday (today's midnight minus one day)
Today (today's midnight)
Tomorrow (today's midnight plus one day)
I was able to reproduce the issue locally at a couple of devices that I installed the app, added the widget to the home screen and left it running for a few days. I would then check the home screen after a while and the problem would manifest itself in different ways:
Sometimes only parts of the SwiftUI view would be refreshed: the label that shows the date would be incorrect, but a different label was refreshed correctly
Sometimes the widget will actually be stuck, showing an entry from 3 days ago
If I have two instances of the widget with different sizes on the same home screen, one of them can be stuck at a past date and another only partially refreshed
The widget uses a different gradient background color each day. That usually (always?) is current.
Sometimes they will work fine for 2-3 days and then start "lagging"
The timeline is being refreshed correctly, has the correct dates and correct TimelineEntry objects.
The SwiftUI view returned to WidgetKit contains all the labels with the correct text and formatted correctly (I did a simple dump of the view like print("\(view)"))
If I go into the devices settings and flip the clock toggle between 12/24 hours, this forces Springboard to refresh the widget and they immediately refresh to the correct view state.
Is this a known issue? Are there any possible workarounds to force WidgetKit always render the widget correctly?
Thanks in advance!