Skip to content

cleanup(path-inspector): remove unreachable showOnMap branch that calls undefined window.drawPacketRoute #143

Closed

Description

@dborup

Summary

Low-priority cleanup. public/path-inspector.js showOnMap() has an "already on #/map" branch that calls window.drawPacketRoute, but public/map.js only exposes window.drawPacketRouteMulti (around line 1368), not window.drawPacketRoute. If that branch ever ran, "Show on map" would silently do nothing.

Not user-visible today (verified by reading master d264716c):

  • The standalone Path Inspector lives at #/tools/path-inspector, so showOnMap() always takes the first branch: it stores window._pendingPathInspectorRoute and navigates to #/map, where map.js (around line 1732) draws it with its local drawPacketRoute. This works.
  • The Path Inspector pane embedded in the map page (map.js, around line 2464) calls the local drawPacketRoute directly. This also works.
  • The else branch in path-inspector.js (around lines 180–191) is therefore unreachable in normal navigation, and it hides a broken call.

Found by the issue-batch agent while working on #123; the user-visible impact it reported was checked and does not hold.

Proposed cleanup

Pick one and keep it small:

  1. Remove the unreachable else branch (and its comment), leaving the pending-route + navigate path as the only behaviour; or
  2. Expose window.drawPacketRoute = drawPacketRoute next to window.drawPacketRouteMulti in map.js, so the branch works if it ever becomes reachable.

Option 1 is preferred (less surface, no new global). If #123's PR already touches the Path Inspector wiring in map.js, this can be folded into it instead.

Acceptance criteria

  • No code path calls an undefined window.drawPacketRoute.
  • "Show on map" from #/tools/path-inspector and from the map's embedded pane still draws the route (existing tests or a small new one).
  • No behaviour change elsewhere.

Activity

  1. added a commit that references this issue on Oct 7, 2026
  2. dborup commented on Oct 7, 2026

    @dborup
    OwnerAuthor

    Fixed by #345 (merged as 69890b8e732fbfdf02d107c45a88ffd84ffdc1d5).

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions