A have a single ArcGIS server map service with 4 layers, added to portal as a map image layer.
This map image layer has been added to a web map, and my app uses this web map.
My custom popup has been configured on all 4 layers.
When clicking on a feature in any layer that isn't the last layer (i.e. id 0-2), the popup is triggered with a selection-change then set-features.
When clicking on a feature in the last layer (i.e. 3), the popup is triggered with set-features then a selection-change.
This makes coding the calls to external services and generating the popup content a lot more complex than it needs to be, ideally I would make one call to my services on set-features, then generate content on selection-change, but this issue prevents that.
Is there a reason for the change in event order for the last layer in a service?
Is there anything I can change to make the events occur in the same order for every layer?