Skip to content

Make timestamps consumed by Navigator.getStatus consistent#2610

Merged
chezzdev merged 8 commits into
masterfrom
pad-navigator-status
Sep 8, 2020
Merged

Make timestamps consumed by Navigator.getStatus consistent#2610
chezzdev merged 8 commits into
masterfrom
pad-navigator-status

Conversation

@chezzdev
Copy link
Copy Markdown
Contributor

@chezzdev chezzdev commented Sep 8, 2020

The PR addresses 3 points described in #2583 to enhance the consistency across timestamps provided to Navigator.getStatus.

Fixes #2583.

@chezzdev chezzdev self-assigned this Sep 8, 2020
@chezzdev chezzdev requested a review from 1ec5 September 8, 2020 18:54
@chezzdev chezzdev added the op-ex Refactoring, Tech Debt or any other operational excellence work. label Sep 8, 2020
Copy link
Copy Markdown
Contributor

@1ec5 1ec5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In addition to the feedback below, can we have ViewController call Router.advanceLegIndex() and restart the navigator instead of reaching into the route progress and modifying the leg index directly, just to demonstrate that this refactor works correctly?

guard router.route.legs.count > router.routeProgress.legIndex + 1 else { return }
router.routeProgress.legIndex += 1
navService.start()

Comment thread CHANGELOG.md Outdated
Comment thread MapboxCoreNavigation/RouteController.swift
Comment thread MapboxCoreNavigation/RouteController.swift Outdated
@1ec5 1ec5 added this to the v1.0.0 milestone Sep 8, 2020
@1ec5 1ec5 added backwards incompatible changes that break backwards compatibility of public API topic: location labels Sep 8, 2020
Comment thread CHANGELOG.md Outdated
Comment on lines +79 to +80
* Removed the `RouteController.projectedLocation(for:)` method in favor of `RouteController.location`. It is no longer possible to predict the user’s location at an arbitrary time. ([#2583](https://github.com/mapbox/mapbox-navigation-ios/issues/2583))
* Renamed the `Router.advanceLegIndex(location:)` method to `Router.advanceLegIndex()`. It is no longer possible to advance to an arbitrary leg using this method. ([#2583](https://github.com/mapbox/mapbox-navigation-ios/issues/2583))
Copy link
Copy Markdown
Contributor

@1ec5 1ec5 Sep 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Typically we’re linking to PRs where the problem and solution are laid out in detail. Not essential though.

Suggested change
* Removed the `RouteController.projectedLocation(for:)` method in favor of `RouteController.location`. It is no longer possible to predict the user’s location at an arbitrary time. ([#2583](https://github.com/mapbox/mapbox-navigation-ios/issues/2583))
* Renamed the `Router.advanceLegIndex(location:)` method to `Router.advanceLegIndex()`. It is no longer possible to advance to an arbitrary leg using this method. ([#2583](https://github.com/mapbox/mapbox-navigation-ios/issues/2583))
* Removed the `RouteController.projectedLocation(for:)` method in favor of `RouteController.location`. It is no longer possible to predict the user’s location at an arbitrary time. ([#2610](https://github.com/mapbox/mapbox-navigation-ios/pull/2610))
* Renamed the `Router.advanceLegIndex(location:)` method to `Router.advanceLegIndex()`. It is no longer possible to advance to an arbitrary leg using this method. ([#2610](https://github.com/mapbox/mapbox-navigation-ios/pull/2610))

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's keep it consistent, thanks for the heads-up.

@chezzdev chezzdev merged commit fcea837 into master Sep 8, 2020
@chezzdev chezzdev deleted the pad-navigator-status branch September 8, 2020 20:26
chezzdev added a commit that referenced this pull request Sep 8, 2020
* Remove projectedLocation method

* Save the timestamp of the last location update and use it for snapped location

* Adjust advanceLegIndex method to increment leg index without concidering the location

* Update changelog

* Bump Nimble patch version

* Review fixes

* Utilize updated API for leg advancing in the example

* Fix changelog links in changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backwards incompatible changes that break backwards compatibility of public API op-ex Refactoring, Tech Debt or any other operational excellence work. topic: location

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RouteController should get navigation statuses based on a consistent timestamp

2 participants