Skip to content

Commit a653c29

Browse files
authored
feat: Add insights support (#668)
1 parent 206dfef commit a653c29

3 files changed

Lines changed: 534 additions & 0 deletions

File tree

lib/launcher.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,12 @@ class Launcher {
561561
}
562562

563563
this.state = States.STARTING
564+
565+
// The node-red node_modules may have been (re)installed or relinked,
566+
// so any previously-resolved MCP SDK could now be stale. Drop the cached
567+
// reference so it is re-resolved against the current install on next use.
568+
this.agent?.mqttClient?.mcp?.resetSdk?.()
569+
564570
if (!existsSync(this.projectDir) ||
565571
!existsSync(this.files.flows) ||
566572
!existsSync(this.files.credentials) ||
@@ -751,6 +757,11 @@ class Launcher {
751757
let finalState = States.STOPPED
752758
this.stopReason = reason || 'shutdown'
753759
info('Stopping Node-RED. Reason: ' + this.stopReason)
760+
761+
// Drop any cached MCP SDK reference: the SDK files may be removed (clean
762+
// stop) or replaced before the next start, so they must not be reused.
763+
this.agent?.mqttClient?.mcp?.resetSdk?.()
764+
754765
if (this.stopReason === States.SUSPENDED) {
755766
finalState = States.SUSPENDED
756767
}

0 commit comments

Comments
 (0)