Skip to content

fix: PluginLayer error boundary and map safety checks#812

Merged
accius merged 1 commit intomainfrom
Staging
Mar 23, 2026
Merged

fix: PluginLayer error boundary and map safety checks#812
accius merged 1 commit intomainfrom
Staging

Conversation

@accius
Copy link
Copy Markdown
Owner

@accius accius commented Mar 23, 2026

  • Wrap each PluginLayer in its own error boundary so a single crashed plugin (getPane().appendChild on a dead map) never takes down the whole dashboard. Boundary auto-resets on projection switch.
  • Add isMapAlive() guard: validates map._container and _panes exist before passing to hooks — prevents effects from using destroyed maps.
  • PluginLayer key now includes projection (az/merc) so hooks fully remount with clean refs when switching map instances.
  • useCityLights: fall back to default pane when nightPane doesn't exist on the azimuthal map.
  • Reject legacy 'azimuthal' mapStyle from localStorage.

What does this PR do?

Type of change

  • Bug fix
  • New feature
  • Performance improvement
  • Refactor / code cleanup
  • Documentation
  • Translation
  • Map layer plugin

How to test

Checklist

  • App loads without console errors
  • Tested in Dark, Light, and Retro themes
  • Responsive at different screen sizes (desktop + mobile)
  • If touching server.js: caches have TTLs and size caps (we serve 2,000+ concurrent users)
  • If adding an API route: includes caching and error handling
  • If adding a panel: wired into Modern, Classic, and Dockable layouts
  • No hardcoded colors — uses CSS variables (var(--accent-cyan), etc.)
  • No .bak, .old, console.log debug lines, or test scripts included

Screenshots (if visual change)

- Wrap each PluginLayer in its own error boundary so a single crashed
  plugin (getPane().appendChild on a dead map) never takes down the
  whole dashboard. Boundary auto-resets on projection switch.
- Add isMapAlive() guard: validates map._container and _panes exist
  before passing to hooks — prevents effects from using destroyed maps.
- PluginLayer key now includes projection (az/merc) so hooks fully
  remount with clean refs when switching map instances.
- useCityLights: fall back to default pane when nightPane doesn't
  exist on the azimuthal map.
- Reject legacy 'azimuthal' mapStyle from localStorage.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@accius accius merged commit 3d1c9d0 into main Mar 23, 2026
3 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant