Written by Claude Code, Opus 4.6. Result of code review with @JeroenDeDauw. Context: the Maps extension codebase.
Issue
In resources/leaflet/LeafletLoader.js (lines 28-37), after VE activation, initializeMaps() runs every second forever via setInterval. The clearInterval code on lines 35-37 is commented out. Intervals accumulate if VE is opened multiple times, causing repeated unnecessary DOM traversals and potential performance degradation.
Steps to reproduce
- Open a page with a map in VisualEditor
- Close VisualEditor
- Open VisualEditor again
- Each time, a new interval is started but the old one is never cleared
Expected behavior
The interval should be cleared when VE is deactivated.
Written by Claude Code, Opus 4.6. Result of code review with @JeroenDeDauw. Context: the Maps extension codebase.
Issue
In
resources/leaflet/LeafletLoader.js(lines 28-37), after VE activation,initializeMaps()runs every second forever viasetInterval. TheclearIntervalcode on lines 35-37 is commented out. Intervals accumulate if VE is opened multiple times, causing repeated unnecessary DOM traversals and potential performance degradation.Steps to reproduce
Expected behavior
The interval should be cleared when VE is deactivated.