brief-restaurant-63679
05/05/2023, 2:23 PMcommand
instance again and again in the ws server instead of doing command = new CommandClass()
This means that all the subscribers get added to the same instance.
Now, when e.g. streaming logs, the subscriber callback gets called for each log event on all subscribers.
So e.g. a log from the api
service gets called on api
, postgres
, vote
et al (assuming the vote example project).
This means the logs viewer will print the same log line for each subscribing service.
I'm not entirely sure why this worked on 0.12 tbh but it's certainly an issue on 0.13.
My first reaction would be to initialise the command per request as opposed to pre-initialising, but not sure how that jives with other invariants. We've been pre-initialising commands in the commands/commands.ts
file for forever.
A quick fix would be to handle this in the callback and only send a message for the services the callback cares about, but that feels pretty hacky and doesn't generalise to other commands.
Any thoughts? (cc @alert-helicopter-61082 , since you've done some work on this)alert-helicopter-61082
05/05/2023, 3:26 PMbrief-restaurant-63679
05/05/2023, 3:28 PMalert-helicopter-61082
05/05/2023, 3:29 PMbrief-restaurant-63679
05/05/2023, 3:32 PM