Hi everyone,
I'm facing an issue with WidgetCenter.shared.getCurrentConfigurations() and I'm trying to determine whether this is expected behavior or a WidgetKit bug.
Environment
-
WidgetKit with
IntentConfiguration -
One widget kind:
PhotoBoxWidgetGroup -
Supported families:
.systemSmall.systemMedium.systemLarge
Steps to reproduce
- Fresh install the app.
- Add the
PhotoBoxWidgetGroupwidget to the Home Screen. - Resize the widget between Small, Medium, and Large (or create different sizes during testing).
- Delete all instances of the widget from the Home Screen.
- Call:
WidgetCenter.shared.getCurrentConfigurations { result in
...
}
Expected Result
Since there are no widgets on the Home Screen, I expect:
Widget count: 0
Actual Result
getCurrentConfigurations() still returns three configurations:
Widget count: 3
Kind: PhotoBoxWidget
Family: systemLarge
configuration: nil
widgetConfigurationIntent: nil
Kind: PhotoBoxWidget
Family: systemMedium
configuration: nil
widgetConfigurationIntent: nil
Kind: PhotoBoxWidget
Family: systemSmall
configuration: nil
widgetConfigurationIntent: nil
Although there are no widgets on the Home Screen, WidgetKit continues to report one configuration for each supported family.
Additional observations
-
This does not happen immediately after a fresh install.
-
The issue appears only after the widget has been resized.
-
If I restart the device,
getCurrentConfigurations()correctly returns 0. -
After adding the widget again, resizing it, and deleting it, the issue reappears.
-
I have also tried:
- reinstalling the app
- adding confirmation delays before querying
- querying only when the app becomes active
- filtering by
kind - comparing snapshots
-
The result is always the same.
Question
Has anyone experienced WidgetCenter.shared.getCurrentConfigurations() returning stale widget configurations after widgets have been resized and removed?
Is this a known WidgetKit issue, or is there an additional step required to ensure deleted widget configurations are removed from getCurrentConfigurations()?
Any guidance or confirmation would be greatly appreciated.