File > New keeps the previous map's scripts, prefabs, fonts and glyphs #95

Open
opened 2026-10-13 02:28:36 +00:00 by ImBenji · 0 comments
Owner

From the engineering review on 2026-10-13.

reset() in lib/provider/map_data_state.dart:2984 clears segments, lines, stations, canvas objects, collections and the parent maps, but not _scripts, _scriptParentOf, _prefabs, _customFonts or _glyphs. After File > New the previous map's scripts, prefabs (now pointing at deleted master collections), embedded fonts and glyphs are still there and get saved into the new file.

Evidence: test/review_probes/engine_model_ops_probe.dart (local, untracked) prints after reset: scripts=1 prefabs=1 scriptParentOf=1 collections=0. Fonts and glyphs are from reading the same function.

Fix sketch: clear the five missing collections in reset() and evict the font and glyph caches the way hydrate does.

From the engineering review on 2026-10-13. `reset()` in `lib/provider/map_data_state.dart:2984` clears segments, lines, stations, canvas objects, collections and the parent maps, but not `_scripts`, `_scriptParentOf`, `_prefabs`, `_customFonts` or `_glyphs`. After File > New the previous map's scripts, prefabs (now pointing at deleted master collections), embedded fonts and glyphs are still there and get saved into the new file. **Evidence:** `test/review_probes/engine_model_ops_probe.dart` (local, untracked) prints `after reset: scripts=1 prefabs=1 scriptParentOf=1 collections=0`. Fonts and glyphs are from reading the same function. **Fix sketch:** clear the five missing collections in `reset()` and evict the font and glyph caches the way `hydrate` does.
ImBenji added the bug label 2026-10-13 02:28:36 +00:00
ImBenji added this to the Arcs & Angles project 2026-10-13 02:28:36 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: IMBENJI.NET/Metro-Map-Maker#95