Closed endreszabo closed 3 years ago
It sounds like you have made the jump from 1.x to 2.x, so it is expected that some things will break. We follow semver so version jumps like this is when we are allowed to do breaking changes and we ended up with a few things.
The naming was changed as part of a general renaming and tidying, but the events should have been updated to match. So yes the incorrect paths is a bug. I shall try and get this fixed this evening, and write some tests to ensure the same issue isnt present elsewhere
This was an intentional change because often the events would be working with an incomplete and broken state tree, as we were still receiving data. Additionally, for some of the larger models we receive some hundreds of commands, so emitting an event like we were was likely to be a bit of a performance problem. So yes, it is best to listen for 'connected' and do a full update when that is received (which will also happen upon reconnection)
Often multiple updates get received from the atem in a single packet, so we now treat those as a single update. This is especially relevant in fairlight, as sometimes the atem will remove an audio channel and add a replacement.
Thank you very much for your detailed and prompt answer. The version jump must have been a major one. :)
For point 2: is the state tree considered complete when the connected
event gets emitted?
Yes, when connected
is emitted that means that the tree will be complete.
I have written a fix for your issue, I just need to do a bit more testing before publishing a release
I believe the last issue flagged here has been resolved as of v2.2.2, the rest was intentional changes. Let me know if I have missed anything
I'm submitting a ... [ ] bug report [ ] feature request [ ] question about the decisions made in the repository [x] question about how to use this project
Summary
Up until yesterday I've been using a $previous version I installed from npm like 3 weeks ago. Now I use the recently published 2.1.0. There must have been some significant changes which made my simple node script fail.
I got the following problems:
Major: The
stateChange
event gets emitted for tree itemvideo.ME.0.programInput
. I use theobject-path
to get the referenced tree item that returns undefined as the state tree has changed the name forME
leaf tomixEffects
so the correct path would bevideo.mixEffects.0.programInput
. My workaround is that now I replace.ME.
in the emitted path string to.mixEffects.
which is.. unprofessional. :)Minor: Formerly upon startup every state 'final' path node have emitted a
stateChange
event and using that I could fill up my macro and input variables. Now I have to use.on('connected')
and fetch those values manually. Is it should be done this way from now on?stateChange now emits an array of state tree paths instead of a single path as before. Workaround is to use a
.forEach()
on the paths.I guess ME->mixEffects is a thing in transition. No idea about the others, pls confirm if things will go this way from now on and I'll adapt.
And as always, thank you very much for this lib. Keep up the good work! :+1: