Widget getTimeline method called multiple times for customized intents - is this expected?

In my iOS 14 widget with a single custom intent, when the user selects one intent, then changes to another, my getTimeline method is called multiple times for each intent per refresh - including previously-selected ones.

I would expect getTimeline to only be called with the currently-selected intent. Am I misunderstanding how widgets are designed?

Is there a way to check whether the intent is the currently-selected intent? I make a network request in the getTimeline method and I do not want to make multiple requests when the widget only shows one intent.

As an example, I downloaded the Emoji Ranger sample code and added a print statement to the getTimeline method. I then:
  1. Run the app and open it once.

  2. Add a widget to the home screen.

  3. Run the widget extension target on the simulator.

  4. Select the character Egghead.

  5. Select the character Cake.

This is what prints on the next widget refresh (usually ~15 mins):

Code Block
- Timeline: nil
- Timeline: Optional("Egghead")
- Timeline: Optional("Cake")


I noticed that sometimes it calls getTimeline with previous intents in an unexpected order (not old-recent). Any help is much appreciated, thanks!
It's a bug on Apple side and it seems they have no intent on fixing it.
Widget getTimeline method called multiple times for customized intents - is this expected?
 
 
Q