Mapbox-navigation-android: NullPointerException when formatting telemetry date

Created on 17 Nov 2020  路  16Comments  路  Source: mapbox/mapbox-navigation-android

Might be related to https://github.com/mapbox/mapbox-navigation-android/issues/3765. Reproduced on v1.3.0-alpha.1.

11-17 15:40:21.464 4540-4562/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: MapboxMetricsReporter.init from MapboxNavigation main
11-17 15:40:21.467 4540-4562/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: onOffRouteStateChanged false
11-17 15:40:21.467 4540-4562/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: session state is IDLE
11-17 15:40:21.467 4540-4562/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: sessionStop
11-17 15:40:21.467 4540-4562/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: resetOriginalRoute
11-17 15:40:21.467 4540-4562/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: resetRouteProgress
11-17 15:40:21.467 4540-4562/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: Valid initialization
11-17 15:40:21.488 4540-4540/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: session state is FREE_DRIVE
11-17 15:40:21.488 4540-4540/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: sessionStop
11-17 15:40:21.488 4540-4540/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: resetOriginalRoute
11-17 15:40:21.488 4540-4540/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: resetRouteProgress
11-17 15:40:21.488 4540-4540/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: trackFreeDrive START
11-17 15:40:21.488 4540-4540/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: wait for location
11-17 15:40:21.497 4540-4540/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: Lifecycle monitor created
11-17 15:40:21.497 4540-4540/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: location not ready
11-17 15:40:21.501 4540-4540/com.mapbox.navigation.instrumentation_tests W/LocationUpdateReceiver: LocationEngineResult == null
11-17 15:40:21.516 4540-4540/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: session state is ACTIVE_GUIDANCE
11-17 15:40:21.516 4540-4540/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: flush buffer. Pending events = 0
11-17 15:40:21.516 4540-4540/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: trackFreeDrive STOP
11-17 15:40:21.516 4540-4540/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: createFreeDriveEvent STOP
11-17 15:40:21.518 4540-4540/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: populateNavigationFreeDriveEvent
11-17 15:40:21.519 4540-4562/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: MapboxNavigation onDestroy
11-17 15:40:21.520 4540-4562/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: session state is IDLE
11-17 15:40:21.520 4540-4562/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: sessionStop
11-17 15:40:21.520 4540-4562/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: resetOriginalRoute
11-17 15:40:21.520 4540-4562/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: resetRouteProgress
11-17 15:40:21.520 4540-4562/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: trackFreeDrive STOP
11-17 15:40:21.520 4540-4562/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: createFreeDriveEvent STOP
11-17 15:40:21.522 4540-4562/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: populateNavigationFreeDriveEvent
11-17 15:40:21.584 4540-4540/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: location ready
11-17 15:40:21.584 4540-4540/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: createFreeDriveEvent START
11-17 15:40:21.584 1565-1583/system_process W/ActivityManager: Unable to start service Intent { act=com.google.android.gms.nearby.discovery:ACTION_PERMISSION_CHANGE cmp=com.google.android.gms/.nearby.discovery.service.DiscoveryService } U=0: not found
11-17 15:40:21.586 4540-4540/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: populateNavigationFreeDriveEvent
11-17 15:40:21.586 4540-4540/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: class com.mapbox.navigation.core.telemetry.events.NavigationFreeDriveEvent event sent
11-17 15:40:21.587 4540-4540/com.mapbox.navigation.instrumentation_tests D/LifecycleMonitor: Lifecycle status change: com.mapbox.navigation.instrumentation_tests.activity.EmptyTestActivity@3ca8b5b3 in: PAUSED
11-17 15:40:21.604 4540-4562/com.mapbox.navigation.instrumentation_tests E/TestRunner: java.lang.NullPointerException: Attempt to invoke virtual method 'long java.util.Date.getTime()' on a null object reference
        at java.util.Calendar.setTime(Calendar.java:1195)
        at java.text.SimpleDateFormat.formatImpl(SimpleDateFormat.java:518)
        at java.text.SimpleDateFormat.format(SimpleDateFormat.java:820)
        at java.text.DateFormat.format(DateFormat.java:307)
        at com.mapbox.android.telemetry.TelemetryUtils.generateCreateDateFormatted(TelemetryUtils.java:190)
        at com.mapbox.navigation.core.telemetry.MapboxNavigationTelemetry.populate(MapboxNavigationTelemetry.kt:533)
        at com.mapbox.navigation.core.telemetry.MapboxNavigationTelemetry.access$populate(MapboxNavigationTelemetry.kt:100)
        at com.mapbox.navigation.core.telemetry.MapboxNavigationTelemetry$trackFreeDrive$1.invoke(MapboxNavigationTelemetry.kt:296)
        at com.mapbox.navigation.core.telemetry.MapboxNavigationTelemetry.trackFreeDrive(MapboxNavigationTelemetry.kt:322)
        at com.mapbox.navigation.core.telemetry.MapboxNavigationTelemetry.handleStateChanged(MapboxNavigationTelemetry.kt:277)
        at com.mapbox.navigation.core.telemetry.MapboxNavigationTelemetry.onNavigationSessionStateChanged(MapboxNavigationTelemetry.kt:260)
        at com.mapbox.navigation.core.NavigationSession.setState(NavigationSession.kt:22)
        at com.mapbox.navigation.core.NavigationSession.updateState(NavigationSession.kt:42)
        at com.mapbox.navigation.core.NavigationSession.setDriving(NavigationSession.kt:37)
        at com.mapbox.navigation.core.NavigationSession.onSessionStateChanged(NavigationSession.kt:71)
        at com.mapbox.navigation.core.trip.session.MapboxTripSession.setState(MapboxTripSession.kt:123)
        at com.mapbox.navigation.core.trip.session.MapboxTripSession.stop(MapboxTripSession.kt:201)
        at com.mapbox.navigation.core.MapboxNavigation.onDestroy(MapboxNavigation.kt:351)
        at com.mapbox.navigation.core.MapboxNavigationProvider.destroy(MapboxNavigationProvider.kt:49)
        at com.mapbox.navigation.instrumentation_tests.utils.MapboxNavigationRule.finished(MapboxNavigationRule.kt:18)

/cc @korshaknn @Guardiola31337

bug release blocker

Most helpful comment

Discussed this briefly with @Guardiola31337 now. The priority is to track free drive sessions vs active guidance sessions. In other words, I rather have the free drive events even if there're no location values.

All 16 comments

Reproducible when running this test on https://github.com/mapbox/mapbox-navigation-android/commit/aa5618f75e0818dd8d7936f242ef809faef136f2 run on Android 21 emulator (which makes the location updates fail to be delivered and reproduces the issue).

Problem here is

11-17 15:40:21.501 4540-4540/com.mapbox.navigation.instrumentation_tests W/LocationUpdateReceiver: LocationEngineResult == null

If location is null STOP doesn't get updated (location ready is not print out) and START :boom:

null is not valid in this case, although we've seen it in the past from some manufacturers.

cc @korshaknn

Another example, I think location updates are delivered here correctly:

2020-11-17 17:06:55.355 10448-10498/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: MapboxMetricsReporter.init from MapboxNavigation main
2020-11-17 17:06:55.357 10448-10551/com.mapbox.navigation.instrumentation_tests W/CrashReporter: Root directory doesn't exist
2020-11-17 17:06:55.362 10448-10498/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: onOffRouteStateChanged false
2020-11-17 17:06:55.362 10448-10498/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: session state is IDLE
2020-11-17 17:06:55.362 10448-10498/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: sessionStop
2020-11-17 17:06:55.362 10448-10498/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: resetOriginalRoute
2020-11-17 17:06:55.362 10448-10498/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: resetRouteProgress
2020-11-17 17:06:55.366 10448-10498/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: Valid initialization
2020-11-17 17:06:55.379 23891-24232/? I/BeaconBle: Client requested scan, settings=BleSettings [scanMode=LOW_LATENCY, callbackType=ALL_MATCHES, reportDelayMillis=0, 5 filters, 1 clients, callingClientName=Nearby] [CONTEXT service_id=111 ]
2020-11-17 17:06:55.392 23891-24232/? I/BeaconBle: 'L' hardware scan: 2 filters, scanMode=2, reportdelay=0, callback type=1, #clients=1, workSource=WorkSource{10012 com.google.android.gms} [CONTEXT service_id=111 ]
2020-11-17 17:06:55.402 10448-10448/com.mapbox.navigation.instrumentation_tests W/LocationUpdateReceiver: LocationEngineResult == null
2020-11-17 17:06:55.404 23891-24232/? I/BeaconBle: Starting scan on OS scanner. BT state: 15 [CONTEXT service_id=111 ]
2020-11-17 17:06:55.404 23891-24232/? D/BluetoothAdapter: isLeEnabled(): BLE_ON
2020-11-17 17:06:55.414 10379-10558/? I/bt_stack: [INFO:gatt_api.cc(947)] GATT_Register 79428d9b-ba6a-1b8f-a0e0-7416e7a32c93
2020-11-17 17:06:55.414 10379-10558/? I/bt_stack: [INFO:gatt_api.cc(967)] allocated gatt_if=6
2020-11-17 17:06:55.414 23891-24214/? D/BluetoothLeScanner: onScannerRegistered() - status=0 scannerId=6 mScannerId=0
2020-11-17 17:06:55.424 10448-10448/com.mapbox.navigation.instrumentation_tests D/CompatibilityChangeReporter: Compat change id reported: 148964793; UID 11012; state: ENABLED
2020-11-17 17:06:55.448 10448-10448/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: session state is FREE_DRIVE
2020-11-17 17:06:55.448 10448-10448/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: sessionStop
2020-11-17 17:06:55.448 10448-10448/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: resetOriginalRoute
2020-11-17 17:06:55.448 10448-10448/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: resetRouteProgress
2020-11-17 17:06:55.448 10448-10448/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: trackFreeDrive START
2020-11-17 17:06:55.448 10448-10448/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: wait for location
2020-11-17 17:06:55.485 10448-10448/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: Lifecycle monitor created
2020-11-17 17:06:55.487 10448-10448/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: location not ready
2020-11-17 17:06:55.498 23891-23891/? I/TrustAgent: TAG: TrustAgent.Tracker. [GeofenceTracker] Receive action: com.google.android.gms.auth.trustagent.trustlet.ACTION_PERSONAL_GEOFENCE [CONTEXT service_id=84 ]
2020-11-17 17:06:55.498 23891-23891/? I/TrustAgent: TAG: TrustAgent.Tracker. [GeofenceTracker] exit [CONTEXT service_id=84 ]
2020-11-17 17:06:55.502 10448-10567/com.mapbox.navigation.instrumentation_tests I/MockWebServer: MockWebServer[48952] received request: GET /directions/v5/mapbox/driving/-77.031991,38.894721;-77.030923,38.895433?access_token=pk.eyJ1IjoibHVrYXNwYWN6b3MiLCJhIjoiY2phMnE0ZTZlMmc3NDJxcG82MWNlcHV6ZCJ9.FAw-i97z7eh61baosyzVxQ&alternatives=false&geometries=polyline6&overview=full&steps=true&continue_straight=false&annotations=congestion%2Cdistance&language=en&roundabout_exits=false&voice_instructions=true&banner_instructions=true&voice_units=imperial&enable_refresh=false&sku=108khm66fk7243cd1423cdf4381b19782bf5526d79e HTTP/1.1 and responded: HTTP/1.1 200 OK
2020-11-17 17:06:55.502 23891-23891/? I/TrustAgent: TAG: TrustAgent. [GoogleTrustAgentChimeraService] Trust state changed, trusted: false reason:  [CONTEXT service_id=84 ]
2020-11-17 17:06:55.522 1407-1949/? E/AppOps: Operation not started: uid=10012 pkg=com.google.android.gms(null) op=ACTIVITY_RECOGNITION
2020-11-17 17:06:55.526 10448-10448/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: session state is ACTIVE_GUIDANCE
2020-11-17 17:06:55.526 10448-10448/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: flush buffer. Pending events = 0
2020-11-17 17:06:55.526 10448-10448/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: trackFreeDrive STOP
2020-11-17 17:06:55.526 10448-10448/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: createFreeDriveEvent STOP
2020-11-17 17:06:55.538 10448-10448/com.mapbox.navigation.instrumentation_tests E/TelemetryUtils: java.lang.SecurityException: getDataNetworkTypeForSubscriber
2020-11-17 17:06:55.543 1874-1874/? I/Elmyra/ElmyraService: Unblocked; current action: LaunchOpa [mIsGestureEnabled -> true; mIsOpaEnabled -> true]
2020-11-17 17:06:55.545 1874-1874/? I/Elmyra/ElmyraService: Unblocked; current action: LaunchOpa [mIsGestureEnabled -> true; mIsOpaEnabled -> true]
2020-11-17 17:06:55.549 10448-10448/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: populateNavigationFreeDriveEvent
2020-11-17 17:06:55.550 10448-10448/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: location ready
2020-11-17 17:06:55.550 10448-10448/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: createFreeDriveEvent START
2020-11-17 17:06:55.551 10448-10498/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: MapboxNavigation onDestroy
2020-11-17 17:06:55.555 10448-10498/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: session state is IDLE
2020-11-17 17:06:55.555 10448-10498/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: sessionStop
2020-11-17 17:06:55.556 10448-10498/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: resetOriginalRoute
2020-11-17 17:06:55.556 10448-10498/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: resetRouteProgress
2020-11-17 17:06:55.556 10448-10498/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: trackFreeDrive STOP
2020-11-17 17:06:55.556 10448-10498/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: createFreeDriveEvent STOP
2020-11-17 17:06:55.567 10448-10498/com.mapbox.navigation.instrumentation_tests E/TelemetryUtils: java.lang.SecurityException: getDataNetworkTypeForSubscriber
2020-11-17 17:06:55.568 10448-10448/com.mapbox.navigation.instrumentation_tests E/TelemetryUtils: java.lang.SecurityException: getDataNetworkTypeForSubscriber
2020-11-17 17:06:55.569 10448-10498/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: populateNavigationFreeDriveEvent
2020-11-17 17:06:55.571 10448-10448/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: populateNavigationFreeDriveEvent
2020-11-17 17:06:55.572 10448-10448/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: class com.mapbox.navigation.core.telemetry.events.NavigationFreeDriveEvent event sent
2020-11-17 17:06:55.574 10448-10498/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: class com.mapbox.navigation.core.telemetry.events.NavigationFreeDriveEvent event sent
2020-11-17 17:06:55.588 1005-1043/? D/CHRE: @ 200060.582: Parsed nanoapp message from host: app ID 0x476f6f676c00100b, endpoint 0x8, msgType 112, payload size 10
2020-11-17 17:06:55.589 1005-1043/? I/CHRE: @ 200060.582: [NanoMinion] received MSG Type 0x70, Version 1, 6 bytes
2020-11-17 17:06:55.589 1005-1043/? I/CHRE: @ 200060.582: [AR_CHRE] request.flush
2020-11-17 17:06:55.589 1005-1043/? I/CHRE: @ 200060.582: [AR_CHRE] send to host, reason=3, sampleSize=0, transitionSize=0, lastAccelTime = 199973833, lastAudioTime = 0 
2020-11-17 17:06:55.589 1005-1043/? I/CHRE: @ 200060.582: [NanoMinion] sent MSG Type 0x72, Version 0, 19 bytes, MessageId 101
2020-11-17 17:06:55.618 1005-1043/? D/CHRE: @ 200060.611: Nanoapp list request from client ID 2
2020-11-17 17:06:55.621 10448-10448/com.mapbox.navigation.instrumentation_tests W/mentation_test: Accessing hidden field Landroid/app/Activity;->mResultCode:I (greylist, reflection, allowed)
2020-11-17 17:06:55.621 10448-10448/com.mapbox.navigation.instrumentation_tests W/mentation_test: Accessing hidden field Landroid/app/Activity;->mResultData:Landroid/content/Intent; (greylist, reflection, allowed)
2020-11-17 17:06:55.623 1005-1043/? D/CHRE: @ 200060.616: Nanoapp list request from client ID 2
2020-11-17 17:06:55.626 10448-10448/com.mapbox.navigation.instrumentation_tests D/LifecycleMonitor: Lifecycle status change: com.mapbox.navigation.instrumentation_tests.activity.EmptyTestActivity@ec912df in: PAUSED
2020-11-17 17:06:55.626 10448-10448/com.mapbox.navigation.instrumentation_tests D/LifecycleMonitor: running callback: androidx.test.rule.ActivityTestRule$LifecycleCallback@8a53b0b
2020-11-17 17:06:55.626 10448-10448/com.mapbox.navigation.instrumentation_tests D/LifecycleMonitor: callback completes: androidx.test.rule.ActivityTestRule$LifecycleCallback@8a53b0b
2020-11-17 17:06:55.628 1005-1043/? D/CHRE: @ 200060.619: Parsed nanoapp message from host: app ID 0x476f6f676c001004, endpoint 0x8, msgType 49, payload size 18
2020-11-17 17:06:55.628 1005-1043/? I/CHRE: @ 200060.620: [NanoMinion] received MSG Type 0x31, Version 0, 14 bytes
2020-11-17 17:06:55.631 1005-1043/? D/CHRE: @ 200060.625: Parsed nanoapp message from host: app ID 0x476f6f676c001004, endpoint 0x8, msgType 49, payload size 18
2020-11-17 17:06:55.632 1005-1043/? I/CHRE: @ 200060.625: [NanoMinion] received MSG Type 0x31, Version 0, 14 bytes
2020-11-17 17:06:55.634 10448-10501/com.mapbox.navigation.instrumentation_tests I/MockWebServer: MockWebServer[48952] done accepting connections: Socket closed
2020-11-17 17:06:55.636 10448-10498/com.mapbox.navigation.instrumentation_tests E/TestRunner: failed: route_completes(com.mapbox.navigation.instrumentation_tests.core.SanityCoreRouteTest)
2020-11-17 17:06:55.636 10448-10498/com.mapbox.navigation.instrumentation_tests E/TestRunner: ----- begin exception -----
2020-11-17 17:06:55.642 10448-10498/com.mapbox.navigation.instrumentation_tests E/TestRunner: java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.NullPointerException: Attempt to invoke virtual method 'long java.util.Date.getTime()' on a null object reference

Nah, same

2020-11-17 17:06:55.402 10448-10448/com.mapbox.navigation.instrumentation_tests W/LocationUpdateReceiver: LocationEngineResult == null
2020-11-17 17:06:55.448 10448-10448/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: session state is FREE_DRIVE
2020-11-17 17:06:55.448 10448-10448/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: sessionStop
2020-11-17 17:06:55.448 10448-10448/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: resetOriginalRoute
2020-11-17 17:06:55.448 10448-10448/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: resetRouteProgress
2020-11-17 17:06:55.448 10448-10448/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: trackFreeDrive START
2020-11-17 17:06:55.448 10448-10448/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: wait for location
2020-11-17 17:06:55.485 10448-10448/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: Lifecycle monitor created
2020-11-17 17:06:55.487 10448-10448/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: location not ready
2020-11-17 17:06:55.526 10448-10448/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: session state is ACTIVE_GUIDANCE
2020-11-17 17:06:55.526 10448-10448/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: flush buffer. Pending events = 0
2020-11-17 17:06:55.526 10448-10448/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: trackFreeDrive STOP
2020-11-17 17:06:55.526 10448-10448/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: createFreeDriveEvent STOP
2020-11-17 17:06:55.549 10448-10448/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: populateNavigationFreeDriveEvent
2020-11-17 17:06:55.550 10448-10448/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: location ready
2020-11-17 17:06:55.550 10448-10448/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: createFreeDriveEvent START
2020-11-17 17:06:55.551 10448-10498/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: MapboxNavigation onDestroy
2020-11-17 17:06:55.555 10448-10498/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: session state is IDLE
2020-11-17 17:06:55.555 10448-10498/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: sessionStop
2020-11-17 17:06:55.556 10448-10498/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: resetOriginalRoute
2020-11-17 17:06:55.556 10448-10498/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: resetRouteProgress
2020-11-17 17:06:55.556 10448-10498/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: trackFreeDrive STOP
2020-11-17 17:06:55.556 10448-10498/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: createFreeDriveEvent STOP
2020-11-17 17:06:55.567 10448-10498/com.mapbox.navigation.instrumentation_tests E/TelemetryUtils: java.lang.SecurityException: getDataNetworkTypeForSubscriber
2020-11-17 17:06:55.568 10448-10448/com.mapbox.navigation.instrumentation_tests E/TelemetryUtils: java.lang.SecurityException: getDataNetworkTypeForSubscriber
2020-11-17 17:06:55.569 10448-10498/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: populateNavigationFreeDriveEvent
2020-11-17 17:06:55.571 10448-10448/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: populateNavigationFreeDriveEvent
2020-11-17 17:06:55.572 10448-10448/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: class com.mapbox.navigation.core.telemetry.events.NavigationFreeDriveEvent event sent
2020-11-17 17:06:55.574 10448-10498/com.mapbox.navigation.instrumentation_tests D/MAPBOX_TELEMETRY: class com.mapbox.navigation.core.telemetry.events.NavigationFreeDriveEvent event sent

If I understand correctly, the telem impl relies on a location sample to be delivered before the route is set, right? We should definitely account for a route being delivered first, even if it's a very rare case.

Agreed. I was only noting that with current implementation the crash is "expected" for that use case.

cc @korshaknn

@Guardiola31337 @LukasPaczos
as you can see, we have the next logs:
trackFreeDrive START
wait for location
location not ready
session state is ACTIVE_GUIDANCE

^^ we do not send FreeDrive(Start) because location not ready. it means we don't populate

dynamicFreeDriveValues.run {
    sessionId = obtainUniversalUniqueIdentifier()
    sessionStartTime = Date()
 }

after that we have:
trackFreeDrive STOP
createFreeDriveEvent STOP
populateNavigationFreeDriveEvent. <- crash because sessionStartTime == null

@LukasPaczos @Guardiola31337
let's imagine:

  • free drive started
  • we are waiting for a location
  • free drive stopped (start event hasn't been sent yet)

what should we do?

  • send only stop (it's confusing to have stop event without start)
  • cancel both (we miss events)
  • handle both with a queue (make logic more complicated and we need time to implement it)
  • send start with null location (the most simple and fast solution, but we miss location). we can wait for a location for some time, for example some seconds, and send it (null or inited)

I say we cancel both free drive started and free drive stopped events if free drive started was not sent. Since we did not emit any location samples, we did not provide any value or anything that we can measure with telemetry.

cc @baddleydone @zugaldia @asinghal22

we did not provide any value or anything that we can measure with telemetry.

Don't we? 馃

As I mentioned, it's rare but we've seen null location updates in the past.

Also, it seems we're interested in tracking the _Free Drive_ sessions irrespective if the location is available or not. Am I right @baddleydone @zugaldia @asinghal22? If so, we could treat the location as optional and implement something around these lines

send start with null location (the most simple and fast solution, but we miss location). we can wait for a location for some time, for example some seconds, and send it (null or inited)

it seems we're interested in tracking the Free Drive sessions irrespective if the location is available or not

That would be a different story :+1:

Discussed this briefly with @Guardiola31337 now. The priority is to track free drive sessions vs active guidance sessions. In other words, I rather have the free drive events even if there're no location values.

Discussed this briefly with @Guardiola31337 now. The priority is to track free drive sessions vs active guidance sessions. In other words, I rather have the free drive events even if there're no location values.

Agreed.

Agree with @zugaldia

Was this page helpful?
0 / 5 - 0 ratings