Skip to content

fix(frontend): create the map once instead of re-initializing on every node update#486

Merged
SimmerV merged 1 commit into
MeshAddicts:developfrom
SimmerV:feature-addition
Jun 6, 2026
Merged

fix(frontend): create the map once instead of re-initializing on every node update#486
SimmerV merged 1 commit into
MeshAddicts:developfrom
SimmerV:feature-addition

Conversation

@SimmerV

@SimmerV SimmerV commented Jun 6, 2026

Copy link
Copy Markdown
Collaborator

Problem

The map randomly flickers, reloads its basemap tiles, and sometimes snaps the
camera back while you're using it. Trigger: any node-list refresh (initial load,
refetch on tab focus/reconnect) tore down and rebuilt the entire MapLibre
instance — reloading tiles and resetting unsaved zoom/pan/pitch.

Root cause

The map-init effect was keyed on serverNode, whose identity changes on every
getNodes cache update, and its cleanup calls map.remove() — so the whole map
was recreated each time.

Fix

Create the map once. Read the server node via a ref for the initial center, and
recenter once on load via a one-time jumpTo instead of a full re-init.

@SimmerV SimmerV self-assigned this Jun 6, 2026
@SimmerV SimmerV added this to meshinfo Jun 6, 2026
@SimmerV SimmerV added the bug Something isn't working label Jun 6, 2026
@github-project-automation github-project-automation Bot moved this to Backlog in meshinfo Jun 6, 2026
@SimmerV SimmerV merged commit b025447 into MeshAddicts:develop Jun 6, 2026
2 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in meshinfo Jun 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Bug(map): flickers on initial load

1 participant