The issue might be with the timeline provider. But basing solely on your code, try reloading the widget right after you insert it.
Like this:
modelContext.insert(word)
WidgetCenter.shared.reloadAllTimelines()
Post
Replies
Boosts
Views
Activity
You can try to reload the widget when the app‘s ”scenePhase” changes and moves into the background. Alternatively, try to consider changing how playlists are edited. Try adding a “Save” button that persists all the changes made in the playlist and reloads the widget instead of saving and reloading every time a change is made.
Answering your question about refreshing specific widgets, think about how many times a user will actually edit their playlists (that is assuming your app is a normal music player), your widget might not need to reload as often as you think.
I managed to fix the issue. I think it had something to do with the targets of the intent swift file. I did some restructuring and it worked flawlessly.
Models created after .fetch() is run also does not appear when it is called again in the widget configuration screen. It only shows models created before the first .fetch() was called and any changes made to those models such as edits or deletion.