Skip to content

Client - Map Debt #173

@jptaylor

Description

@jptaylor

High — Map component should not attempt to fetch when not connected
Defaulting to the map view in the UI when joining will trigger a redundant action dispatch.

High — Stale coverage blocks fetches after warp
_confirmedCoverage in mapSlice is never cleared. If a player warps to a distant region, old coverage rects persist. While rectContains is strict (full containment), nearby warps could cause isRectCovered to incorrectly skip fetches, leaving the player with stale data. Fix: clear _confirmedCoverage and _inFlightRequests when the player's sector changes.

Medium — Initial fetch bypasses coverage tracking
BigMapPanel's initial fetch calls dispatchAction directly instead of requestMapFetch. The fetch rect is never registered, so when SectorMap's reframe effect fires shortly after mount, it could issue a duplicate get-my-map for the same region. Fix: use requestMapFetch for the initial fetch too.

Medium — isFetching cleared on any mapData mutation
The effect watching mapData clears isFetching on ALL mutations — including updateMapSectors server pushes from gameplay (sector ownership changes, etc.), not just fetch completions. A gameplay update mid-fetch would prematurely hide the loading overlay. Fix: track a fetch generation counter so only the matching response clears loading.

Medium — Single-slot pendingMapCenterRequestRef
Only one pending request is tracked. Rapid panning could overwrite it before setRegionalMapData confirms coverage for the earlier fetch. The in-flight rects are tracked in the array, but confirmation only triggers for the last pendingMapCenterRequestRef. Earlier rects expire via the stale timeout instead of being properly promoted.

Low — Dead auto-recenter code
requestMapAutoRecenter, autoRecenterRequested, and _maybeAutoRecenter are still in mapSlice with zero callers. ~60 lines of dead code that adds cognitive load.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions