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

Fix race on set route #4755

Merged
merged 2 commits into from
Aug 26, 2021
Merged

Fix race on set route #4755

merged 2 commits into from
Aug 26, 2021

Conversation

korshaknn
Copy link
Contributor

@korshaknn korshaknn commented Aug 26, 2021

Description

closes #4753

Changelog

<changelog>Fixed an occasional crash when setting a new route while on a non-initial leg of the previous route.</changelog>

Screenshots or Gifs

@korshaknn korshaknn added the bug Defect to be fixed. label Aug 26, 2021
@korshaknn korshaknn self-assigned this Aug 26, 2021
@korshaknn korshaknn requested a review from a team as a code owner August 26, 2021 11:03
Copy link
Member

@LukasPaczos LukasPaczos left a comment

Choose a reason for hiding this comment

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

🚀

Could you add a unit test that verifies that the route reference is only set after the async job finishes?

@LukasPaczos
Copy link
Member

We could now be running into a problem where the RoutesObserver will immediately fire with the new route, while RouteProgress#route still holds the old route. We don't know how developers are interacting with these API and I'm sure there are some assumptions that they are always equal, and those are probably rightful assumptions. Wouldn't it be safer to somehow pause route progress updates while we're waiting for the native set route job to finish?

@korshaknn
Copy link
Contributor Author

@LukasPaczos tests added, RouteProgress issue fixed

Copy link
Member

@LukasPaczos LukasPaczos left a comment

Choose a reason for hiding this comment

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

LGTM. This introduces a lag to location updates while the route is updating but shouldn't be too impactful in most of the scenarios, while we'll probably resolve it with async native setRoute in the future. This all is also related to #4727 since now we're missing even more events.

@korshaknn korshaknn merged commit 6bd6905 into main Aug 26, 2021
@korshaknn korshaknn deleted the knn-set-new-route-crash branch August 26, 2021 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Defect to be fixed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crash when setting a new route while on a non-initial leg of the previous route
2 participants