i8beef / node-red-contrib-castv2

MIT License
22 stars 14 forks source link

Multiplying Status Events Generated #82

Closed ferris-smarthome closed 2 years ago

ferris-smarthome commented 2 years ago

I am seeing that the messages generated by a node instance are increasing in number for each time that I play something through the node. For example, consider the following simple flow:

[{"id":"e6e182af166a9dcf","type":"castv2-sender","z":"977be705.a26bc8","name":"Office Display","connection":"f1a4af68fe59fe69","x":500,"y":1660,"wires":[["8e75744c1290b96d"]]},{"id":"3bad525b9f0fd1f3","type":"inject","z":"977be705.a26bc8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":120,"y":1660,"wires":[["8d7e6bdf37fe3d5e"]]},{"id":"8d7e6bdf37fe3d5e","type":"function","z":"977be705.a26bc8","name":"Play List","func":"msg.payload = \n{\n \"app\": \"DefaultMediaReceiver\",\n \"type\": \"MEDIA\",\n \"media\": \n { \n \"url\": \"http://192.168.0.101:8123/local/wavenet_test.mp3\",\n \"contentType\": \"audio/mp3\"\n }\n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":300,"y":1660,"wires":[["e6e182af166a9dcf"]]},{"id":"8e75744c1290b96d","type":"debug","z":"977be705.a26bc8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":690,"y":1660,"wires":[]},{"id":"f1a4af68fe59fe69","type":"castv2-connection","name":"Office Display","target":"","host":"192.168.86.32","port":"8009"}]

The first time through, I get four messages containing a mediaSessionId, which is what I would expect (IDLE - init, PLAYING - loading file, PLAYING - playing file, IDLE - finished). However, the second time through, I get eight messages, two of each of the expected ones. Third time through, I get twelve, or three for each expected.

I have verified that this is the only instance of the node that I have deployed, and the sequence in the flow I am testing it with is extremely simple.

Any guidance or feedback would be appreciated.

i8beef commented 2 years ago

I think this might actually be an artifact of #79 actually. If I make that change locally I am unable to reproduce, so I will release an update with that and we'll see if that works for you.

i8beef commented 2 years ago

Try 4.1.3

ferris-smarthome commented 2 years ago

I just tried 4.1.3 and can confirm that it is no longer generating extra status messages. Thank you, very much!