You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Are you reporting a bug? Use github issues for bug reports and feature requests. For general questions, please use https://discuss.yjs.dev/
Try to report your issue in the correct repository. Yjs consists of many modules. When in doubt, report it to https://github.com/yjs/yjs/issues/
Describe the bug
Collaboratively editing in Monaco can break the ITextModel content (see screencast). It is reproducible if messages sent by the y-websocket are artificially delayed.
Note: the YText shared data type converges correctly. It's the Monaco editor that's not correctly reflecting the state of the shared type (see second screencast).
Change the WebsocketProvider in yjs-demos/monaco/monaco.js to connect to your local websocket server (i.e. const provider = new WebsocketProvider('ws://localhost:8080', 'monaco-demo', ydoc)
(cd yjs-demos/monaco && npm start)
Open Chrome and Firefox and navigate to http://localhost:8081/monaco/monaco.html in both browsers
Edit in one Monaco editor (similar to what is shown in the screencast) and once the updates come in in the other Monaco editor, start editing concurrently.
Expected behavior
It is expected that both Monaco editors show the same content.
…lete ops when local ops are applied, which can lead to inconsistent ITextModels on the different clients. Using the ITextModel.applyEdits prevents these ops
raedle
added a commit
to raedle/y-monaco
that referenced
this issue
Jan 7, 2021
…lete ops when local ops are applied, which can lead to inconsistent ITextModels on the different clients. Using the ITextModel.applyEdits prevents these ops
raedle
added a commit
to raedle/y-monaco
that referenced
this issue
Jan 7, 2021
…lete ops when local ops are applied, which can lead to inconsistent ITextModels on the different clients. Using the ITextModel.applyEdits prevents these ops
Checklist
Describe the bug
Collaboratively editing in Monaco can break the
ITextModel
content (see screencast). It is reproducible if messages sent by the y-websocket are artificially delayed.Note: the
YText
shared data type converges correctly. It's the Monaco editor that's not correctly reflecting the state of the shared type (see second screencast).To Reproduce
Steps to reproduce the behavior:
yjs-demos
(cd yjs-demos/demo-server && npm install)
(cd yjs-demos/monaco && npm install)
(cd yjs-demos/demo-server && npm install lib0)
y-websocket/bin/utils.js
toyjs-demos/demo-server/utils.js
y-websocket/bin/callback.js
toyjs-demos/demo-server/callback.js
const setupWSConnection = require('y-websocket/bin/utils.js').setupWSConnection
inyjs-demos/demo-server/demo-server.js
toconst setupWSConnection = require('./utils.js').setupWSConnection
send
inutils.js
in asetTimeout
with 15000 ms (https://github.com/yjs/y-websocket/blob/9fd8f41fa8f1e29e3d98e6de8156b4650a89c7f1/bin/utils.js#L217) to artificially delay sending messages to peer clients.(cd yjs-demos/demo-server && npm start)
WebsocketProvider
inyjs-demos/monaco/monaco.js
to connect to your local websocket server (i.e.const provider = new WebsocketProvider('ws://localhost:8080', 'monaco-demo', ydoc)
(cd yjs-demos/monaco && npm start)
http://localhost:8081/monaco/monaco.html
in both browsersExpected behavior
It is expected that both Monaco editors show the same content.
Screenshot
Screencast
https://user-images.githubusercontent.com/489051/103810010-583c2400-500f-11eb-99f2-35e58e5c9d70.mp4
Screencast (with
YText
content logged to console)https://user-images.githubusercontent.com/489051/103834425-36a36280-5038-11eb-9456-d528c5c789e7.mp4
Environment Information
The text was updated successfully, but these errors were encountered: