In yCommProvider, _onMsg treats any message with binary buffers as a ydoc sync message and everything else as a custom message. This is unfortunate, as we wouldn't be able to send custom comm messages that contain binary buffers — they'd be trapped here and processed as ydoc sync messages.
For now this is fine, since we're only partially supporting custom comms. But we should consider a breaking change in both ypywidgets and yjs-widgets to properly define a comm protocol with ydoc sync messages properly separated, e.g. branching on msg.type === 'ydoc-sync' instead of the buffers check.
Originally raised by @martinRenou in #30 (comment).
In
yCommProvider,_onMsgtreats any message with binary buffers as a ydoc sync message and everything else as a custom message. This is unfortunate, as we wouldn't be able to send custom comm messages that contain binary buffers — they'd be trapped here and processed as ydoc sync messages.For now this is fine, since we're only partially supporting custom comms. But we should consider a breaking change in both
ypywidgetsandyjs-widgetsto properly define a comm protocol with ydoc sync messages properly separated, e.g. branching onmsg.type === 'ydoc-sync'instead of the buffers check.Originally raised by @martinRenou in #30 (comment).