Description
When a plugin is updated or upgraded while the server keeps running, the previous plugin implementation still appears to remain active inside the same Node.js process. The new plugin code is loaded as an additional dynamic module instead of fully replacing or disposing the old one.
As a result, multiple dynamic modules/versions for the same plugin can coexist in the Node.js process.
Steps to Reproduce
- Start the server with an installed plugin.
- Update or upgrade that plugin.
- Do not restart the server.
- Observe the Node.js process/runtime modules.
Actual Behavior
- The old plugin program continues running in the Node.js process.
- The upgraded plugin is loaded alongside the old plugin code.
- Multiple dynamic modules for the same plugin may coexist.
- This can lead to duplicated handlers, stale logic, inconsistent state, memory leaks, or unexpected behavior.
Expected Behavior
Updating/upgrading a plugin should either:
- properly stop, dispose, and unload the old plugin runtime before loading the new version; or
- clearly require/enforce a server restart when hot plugin replacement is not supported.
Suggested Direction
Consider adding a plugin lifecycle cleanup step during upgrade, including disposal of background tasks, event listeners, registered handlers, and dynamic module references. If dynamic unloading is not reliable in Node.js, the upgrade flow should mark the server as requiring a restart or block hot replacement.
Description
When a plugin is updated or upgraded while the server keeps running, the previous plugin implementation still appears to remain active inside the same Node.js process. The new plugin code is loaded as an additional dynamic module instead of fully replacing or disposing the old one.
As a result, multiple dynamic modules/versions for the same plugin can coexist in the Node.js process.
Steps to Reproduce
Actual Behavior
Expected Behavior
Updating/upgrading a plugin should either:
Suggested Direction
Consider adding a plugin lifecycle cleanup step during upgrade, including disposal of background tasks, event listeners, registered handlers, and dynamic module references. If dynamic unloading is not reliable in Node.js, the upgrade flow should mark the server as requiring a restart or block hot replacement.