Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Navigation can stop when transitioning between night and day #2766

Closed
johnnewman opened this issue Dec 11, 2020 · 3 comments · Fixed by #2881
Closed

Navigation can stop when transitioning between night and day #2766

johnnewman opened this issue Dec 11, 2020 · 3 comments · Fixed by #2881
Assignees
Labels
bug Something isn’t working UI Work related to visual components, Android Auto, Camera, 3D, voice, etc.

Comments

@johnnewman
Copy link

johnnewman commented Dec 11, 2020

Mapbox Navigation SDK version: 1.1.0 and 1.2.0-alpha.3
Xcode 12.2
iOS 14

Steps to reproduce

  1. Start a navigation session at daylight while simulating along the route.
  2. Open settings and change the time to night.
  3. Reopen the navigation session to transition the night style.
  4. Repeat, flipping from day and night until simulation stops. (It usually only takes one more flip to day)

Expected behavior

Navigation continues running.

Actual behavior

When navigation stops, you can still interact with the map and there is no indicator that it is frozen/paused. Navigation and voice guidance can be restarted by flipping the time back to day or night one more time.

  • Gist containing the example code. This was taken from the SDK installation guide here and tweaked to supply MapboxNavigationService and NavigationOptions instances to the NavigationViewController.
  • Video showing the freeze (with audio). You can see the distance to the next maneuver keeps counting down in the top left corner, but the puck is frozen.
@johnnewman johnnewman changed the title Route simulation can stop when transitioning between night and day Navigation can stop when transitioning between night and day Dec 11, 2020
@johnnewman
Copy link
Author

Updating title and description because I was able to reproduce this while actually navigating in a vehicle, not just simulating a route.

@johnnewman
Copy link
Author

johnnewman commented Dec 14, 2020

I have tried testing this with automatic day/night switching, but the Timer instance that handles this switching in the StyleManager class is not scheduled on a run loop. I think this is another bug because that initializer requires that the Timer be added to a run loop. Or it could be initialized with Timer.scheduledTimer(withTimeInterval:repeats:block:) to automatically be assigned the current run loop.

When I edit that line in StyleManager to scheduledTimer(...), I'm seeing the map style properly update while simulating a drive, without the need to open the Settings app and manually change the system time. Also after making that timer tweak, I haven't seen this same freeze for automatic sunrise or sunset transitions after a few simulated drives. I don't know what causes the freeze when manually changing the system time.

@1ec5 1ec5 added bug Something isn’t working UI Work related to visual components, Android Auto, Camera, 3D, voice, etc. labels Dec 15, 2020
@1ec5 1ec5 added this to the v1.3.0 milestone Dec 15, 2020
@truburt truburt removed this from the e (android-v1.5.0 / ios-v1.3.0) milestone Feb 26, 2021
@azarovalex azarovalex self-assigned this Mar 18, 2021
@johnnewman
Copy link
Author

@azarovalex I am still able to reproduce this issue using MapboxNavigation 1.4.2 on iOS 14.

With the code in the gist:

  1. leave the app while navigating during the daytime
  2. change the system time to night
  3. reopen the app checking that the style updated to night
  4. leave the app once more and reset the system time to day
  5. reenter the app and navigation will be frozen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn’t working UI Work related to visual components, Android Auto, Camera, 3D, voice, etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants