Closed crishoj closed 2 weeks ago
I should note:
I struggle to see how this.activeSubscriptions
could ever be undefined
, and assume the index access Bun complains about is this.activeSubscriptions[key][sample.notificationHandle]
.
There is no null-check at all which is my fault, need to fix that.
I think this issue is possible when you first subscribe to a variable and then the connection closes without unsubscribing (so the PLC keeps sending notifications).
When connecting again, the client receives notification with unknown notification handle. And probably unknown key
too, if that happens just after connecting.
By the way, I still have a one breaking change to commit. I'm changing subscribeSymbol()
to subscribeValue()
to keep the naming consistent. Just a heads up!
Hopefully now fixed in beta.2!
I think this issue is possible when you first subscribe to a variable and then the connection closes without unsubscribing (so the PLC keeps sending notifications).
Makes sense. A situation with stale subscription handles could arise if e.g. the application crashes during development, before unsubscribe()
was called.
Hopefully now fixed in beta.2!
Thanks!
Closing this for now. Let me know if there are still any issues :)
Observed after reconnecting to running PLC with V2: