[Bug]: Multiple telemetry events for one action in CarPlay scenario.
Mapbox Navigation SDK version
v2.0.0-rc.5
Steps to reproduce
- Start Example app with CarPlay
- Observe events:
- sendPassiveNavigationStart
- sendPassiveNavigationStop
Expected behavior
Only one of this event per action is reported.
Actual behavior
Two events are reported per one action.
Root cause
CarPlay controller instantiates its own PassiveLocationManager and there are two of them in total in a Car Play use case. It causes the events above to be called twice: one from the main app and one from the CarPlay.
Is this a one-time issue or a repeatable issue?
repeatable
Creating two instances of PassiveLocationManager for different platforms is not necessarily one action and I guess it'd be beneficial to keep track of every PassiveLocationManager creation/deletion, as it can be done ad-hoc by user on iOS. It might be also be pretty tricky to keep track of previously sent events during CarPlay head-unit connection/disconnection/independent work.
I think that we should keep existing event sending logic without any changes, but add information regarding platform in NavigationEventsManager.userInfo.