Files
kandev/apps/web/lib/plugins
João Salavisa b85ce080d5 fix(plugins): make plugin reload idempotent so re-boot never duplicates slots (#1914)
Installed plugins rendered duplicate UI slot widgets (e.g. the chat-input-actions icon twice) because the append-only slot registry could run a plugin's initialize() again while its prior registrations were still live.

- Make loadPlugin idempotent: revoke a plugin's prior registrations before re-running initialize().
- Fence overlapping/concurrent loads by a per-plugin generation so the newest-initiated load wins and a superseded (older) load can't revoke the successor or append a stale registration.
- Wrap the scoped registry reflectively so every register* method (incl. registerKeybinding) is fenced, never dropped.

Tests: registry-count regression, real-DOM PluginSlot render reproduction, two overlapping-load regressions, and a registerKeybinding-forwarding regression.
2026-07-24 14:31:11 +01:00
..