Route editor: clicking the next point while a leg is still routing appends legs out of order (straight jumps, inflated distance) #68
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
public/wanderer#68
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found in the live acceptance test of
deploy-676a7c62(2026-11-05), userclaude_test. This is probably not new in this deploy: the append path (appendAnchor→calculateRouteBetween→insertIntoRoute(…, undefined, …)) is unchanged by the batch. It does make #45 "Optimise order" report wrong before/after numbers when it happens.Problem: if you click the next route point while the previous leg is still being routed (Valhalla
/route+/height), the legs are appended in the order the responses arrive, not in the order you clicked. The track then contains straight "jump" lines between unrelated legs. Distance, D+/D− and the profile include those jumps.Repro (append mode, Valhalla, Sospel at zoom 13):
/trail/edit/newand switch the toggle to "Appending to end of route".With a full wait after each click (routing done), the same 8 clicks give 19.57 km every time. This also happened once with about 1.2 s between clicks while the cluster was loaded (24.52 km), so a normal click pace can hit it when routing is slow.
Evidence:
/root/tools/wanderer-shots/acceptance/out/bug-race-fast-clicks-loop.png(29.57 km, straight jumps) and/root/tools/wanderer-shots/acceptance/out/t2d-loop-before-optimise.png(the 24.52 km case). Legs:/root/tools/wanderer-shots/acceptance/out/debug_loop_legs.json. Script:FAST=1 GAP=120 node /root/tools/wanderer-shots/acceptance/debug_loop.mjs.Fix idea: serialise route edits. Queue each click's routing behind the previous one, or insert each leg at its anchor's index (not "append at the end") once its response arrives. Add a test with two
calculateRouteBetweenpromises that resolve out of order.🤖 Generated with Claude Code
Fixed in batch PR #72 (
deploy5577c715), live since 2026-11-05 ~22:10 CET inwanderer-web:deploy-5577c715(homelab-flux #857). Verified with the live e2e suite and acceptance re-runs asclaude_test.🤖 Generated with Claude Code