Skip to content

fix(map): ignore stale async work and keep Path Inspector controls usable #123

Description

@dborup

Problem

public/map.js starts asynchronous node/config loads and delayed invalidateSize() work that can complete after the map page is destroyed or replaced. A simple if (map) guard is insufficient because an old callback can mutate a newly created global map. Multiple loadNodes() calls on one instance can also resolve out of order.

The Path Inspector/control layout additionally overlaps or becomes inaccessible at affected desktop/tablet widths.

Upstream reference: Kpa-clawbot/CoreScope#2048.

Acceptance criteria

  • Give every map mount a generation/lifecycle token and every same-instance node load a request generation.
  • Async results and delayed callbacks affect only their active generation; only the newest same-instance load renders.
  • Destroy cancels timers/listeners where practical and makes remaining work inert.
  • Old work cannot clear, recenter, or populate a later map.
  • Path Inspector controls remain visible, non-overlapping, and clickable at supported tablet/desktop widths.
  • Preserve route rendering, filters, saved viewport, and selected-node behavior.

Tests

Cover navigation during pending requests, quick return, reverse-resolution loads, stale invalidateSize, representative tablet/desktop/short-desktop layouts, and blocked clicks/console errors.

Non-goals

No broad map redesign, data semantic change, or deploy.

Activity

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