Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Input is wanted, on whether this is a feature worth having, and whether the rough architecture proposed here is good.
Do not read into the code, and do not critique the UI at this stage.
This is a largely vibe coded implementation of a potential new direction for Companion Cloud.
At this stage I am trying to decide if this is a good direction/architecture and is worth spending more time on. It was an evening of prompting, so I don't mind at all if this gets thrown away as not worthwhile
The long story is that Companion Cloud is deprecated because Bitfocus do not wish to continue with it. Reasons on that are unclear, and not our concern. Some users do utilise and rely on it, and there isn't really a good substitute flow for it. Parts of it can be replaced by satellite, but it has limitations.
I realised that the cloud service is essentially an event bus, used to allow multiple Companions to talk without needing direct connections. So I took that and realised there are a bunch of of the shelf solutions/brokers that could be used to replace that.
By doing that, we allow more flexibility in how this is deployed, and it means that the Companion project doesn't need to host anything for this to be usable.
The design is for there to be a common protocol that can be used over many different transports.
For this POC, I started with a mqtt transport, as there are many off the shelf servers that can be run yourself and setup with tls and basic auth. (I am running mosquitto in docker for testing this)
The final implementation of this should have more transports, and I expect the list will grow over time as users request them.
The intention is that each companion can be setup with multiple transports. each one will be a single 'connection', and companion will eventually talk to each other over multiple to get redundancy.
Because of this bring-your-own-infastructure approach, I am not intending for any form of security within the protocol. Any security should be applied at the transport level (eg user+pass or api key for connecting to the broker).
Although it may be that companion wants to have some access rules to limit how much they expose to link or potentially to a transport. (eg so a peer can be readonly to one mqtt server, but rw to another)
The aim here is to pipe rendered buttons over this link, and push/rotate events back.
This is done in a subscription approach, to minimise the amount of data companion is sending (reducing cost both on companion and the broker).
I also think it would be good to be able to pipe variables over this, but that doesnt feel like MVP.
Instead of implementing the client as a module and being subject to the limitations that imposes, this is done with a new control type. That means that the user doesn't need to deal with adding multiple actions and a feedback to truely mirror a remote button, instead we can handle all that for them, and handle issues they would have encountered with long presses.
Q) How does this behave if using the 'use another buttons style' on one of these buttons?
At this stage, I can say that it kinda works. Its easy to break it, the code is garbage and the ui does not match the style of anything else. But it gives an idea of a new approach that could be taken
Name of 'link' is TBD, but I think makes sense as we are 'linking' companion installations.
Idea for future transports:
some thought probably needs to go into the protocol (particularly around how failover between transports happens) to ensure it is truely modular