EastCoastGreenwayAlliance / ecg-map

Interactive map and trip planner for the ECGA
https://map.greenway.org
7 stars 0 forks source link

Improve failure detection to avoid infinite loop #19

Closed gregallensworth closed 7 years ago

gregallensworth commented 7 years ago

The current logic, will detect a "can't get there" condition only if it backs all the way to the starting node (route.length==1) and has 0 candidates.

I've found a few cases where the result is instead an infinite loop of retrying the same segment, e.g. about 2 or 4 steps in at the first fork, which is not necessarily the starting node. This is an infinite loop, lags the page and freezes, etc.

See about improving this, see why the can't-get-there detection isn't backing up to the first node, and how to work around it.