bitfocus/companion-module-behringer-x32

[BUG] Unclean instance deletion / Import

thedist opened this issue · 3 comments

While trying to assist a user of the vMix module with a bug in the latest major update they shared their Companion Config (available in the issue thread bitfocus/companion-module-studiocoast-vmix#143) there were issues doing a full import.

When importing a specific page I can select which instance in my companion is for which instance in the config, and this imports perfectly fine when specify my vMix module for their config.

When doing a full import though, Companion crashes with the error:

dgram.js:919
    throw new ERR_SOCKET_DGRAM_NOT_RUNNING();
    ^
Error [ERR_SOCKET_DGRAM_NOT_RUNNING]: Not running
    at healthCheck (dgram.js:919:11)
    at Socket.send (dgram.js:643:3)
    at osc.UDPPort.p.sendRaw (C:\Users\jeff\workspace\companion\node_modules\osc\src\platforms\osc-node.js:124:21)
    at osc.UDPPort.p.send (C:\Users\jeff\workspace\companion\node_modules\osc\src\osc-transports.js:60:22)
    at X32Instance.subscribeForUpdates (C:\Users\jeff\workspace\companion\node_modules\companion-module-behringer-x32\dist\index.js:319:18)
    at Timeout._onTimeout (C:\Users\jeff\workspace\companion\node_modules\companion-module-behringer-x32\dist\index.js:253:22)
    at listOnTimeout (internal/timers.js:557:17)
    at processTimers (internal/timers.js:500:7) {
  code: 'ERR_SOCKET_DGRAM_NOT_RUNNING'
}```

Because the importing of the config also attempts to create instances for those modules from the config, and starts them, when I went to delete the x32 instance it would also result in a crash.

issue also exists on a known-good config that then adds the x32 module and then tries to delete or disable it.

Yeah, looks to be introduced in the latest version.
https://github.com/bitfocus/companion-module-behringer-x32/blob/master/src/index.ts#L360 was added, and needs a try wrapper like https://github.com/bitfocus/companion-module-behringer-x32/blob/master/src/index.ts#L195
probably should be done in the same timer too

should be fixed now