electric
electric copied to clipboard
Add `msgType` differentiator to `Message` interface
Currently the ChangeMessage
and ControlMessage
coming from upstream can only be differentiated by whether they have an action
header or control
header.
This has caused a less than ideal experience in branching off to manage these messages, TS type issues, and I foresee more issues with different clients implemented that will all require to differentiate between the two.
The suggestion is to add a top level property called msgType
, perhaps integer based (e.g. 0 or 1) to save bandwidth, or control
and change
if we don't care that much. If we want this to be part of the protocol at the sync service level then doing an integer flag is probably best.
Suggestion from @samwillis and I, @KyleAMathews also expressed support for easier differentiation.