Skip to content

NAVAND-940: fix buildings highlighting #6749

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

Closed
wants to merge 1 commit into from
Closed

NAVAND-940: fix buildings highlighting #6749

wants to merge 1 commit into from

Conversation

dzinad
Copy link
Contributor

@dzinad dzinad commented Dec 15, 2022

I basically reverted building related changed from #6005. We don't really deal with waypoints there, only waypoint targets (that have the same size asRoutesOptions#coordinatesList). And for these things we use leg index. So nothing waypoint related. All the indices and lists stay valid even after introducing EV waypoints.
The question is whether we want to highlight EV chargers. If yes, I think we can do it separately. For now let's fix old behaviour.

@codecov
Copy link

codecov bot commented Dec 15, 2022

Codecov Report

Merging #6749 (c8bc7ab) into main (c8bc7ab) will not change coverage.
The diff coverage is n/a.

❗ Current head c8bc7ab differs from pull request most recent head 1509cd8. Consider uploading reports for the commit 1509cd8 to get more accurate results

Impacted file tree graph

@@            Coverage Diff            @@
##               main    #6749   +/-   ##
=========================================
  Coverage     72.54%   72.54%           
  Complexity     5521     5521           
=========================================
  Files           772      772           
  Lines         29888    29888           
  Branches       3531     3531           
=========================================
  Hits          21682    21682           
  Misses         6793     6793           
  Partials       1413     1413           

@dzinad dzinad force-pushed the NAVAND-940-dd branch 2 times, most recently from 5c5f22d to 0af4bcb Compare December 15, 2022 14:14
val waypointIndex = action.progress.currentLegProgress?.legIndex!! + 1
val waypoint = waypoints.filter { it.isLegWaypoint() }.getOrNull(waypointIndex)
return BuildingResult.GetDestination(waypoint?.target ?: waypoint?.location)
val routeOptions = action.progress.route.routeOptions()
Copy link
Contributor

Choose a reason for hiding this comment

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

the intention of doing this changed is EV waypoints, that added implicitly and this logic is not working.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What exactly is not working? I don't see anything here that would be affected by adding EV waypoints.

Copy link
Contributor

Choose a reason for hiding this comment

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

@RingerJK could you demonstrate the issue with a unit test?

It seems we're trying to get this into the 2.10.0-rc.1, and it'd be nice to release that soon

Copy link
Contributor

Choose a reason for hiding this comment

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

let me provide the sample:

  • the SDK requested an EV route with 2 waypoints (origin and destination);
  • received the route with an additional waypoint in the middle (EV waypoint);
  • so we have the route with 3 waypoints, 2 legs, but originally we requested 1 leg route (2 waypoints)
  • as soon as we start to work with requested waypoints (RouteOptions) we get inconsistency because routeProgerss#legIndex == 1 is actually not the destination, it's the EV waypoint.

Copy link
Contributor

Choose a reason for hiding this comment

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

We have 2 APIs: queryBuildingOnWaypoint and queryBuildingOnFinalDestination. In the example provided above, I would guess that queryBuildingOnWaypoint would be triggered when the user reaches the 1st waypoint and queryBuildingOnFinalDestination will be triggered when they reach the final destination. What am I missing?

cc @RingerJK

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, legIndex is also affected.
Then we can't merge it. Thanks, I'll continue investigating tomorrow.

Copy link
Contributor

Choose a reason for hiding this comment

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

@abhishek1508 at my example when you arrive at the first waypoint and try to take waypoint data via queryBuildingOnWaypoint you will receive data for destination because the index of destination in RouteOptions is actually 1. Does it make sense?

@dzinad
Copy link
Contributor Author

dzinad commented Dec 16, 2022

Closing in favour of #6754.

@dzinad dzinad closed this Dec 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants