Skip to content

setInterval never cleared in LeafletLoader.js causes interval accumulation in VE #864

@JeroenDeDauw

Description

@JeroenDeDauw

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

  1. Open a page with a map in VisualEditor
  2. Close VisualEditor
  3. Open VisualEditor again
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions