When using the new move feature from a Yjs client, If there is a Ypy client connected, the first client (the Yjs client that moved an element) receives an event undoing the move.
Everything works fine if there is not a Ypy client connected or if the client moving an element is a python client (Ypy) .
I suspect the problem comes from my PR for the move feature #83, which I guess is missing handling a moving event coming from another client.
I have been looking into the code to see how Yrs or Ypy handles the events coming from other clients but I couldn't find anything.
@Waidhoferj, @Horusiath or @dmonad do you know where should I look in the code to debug it?
Context
To reproduce the bug you can use a Yjs client like:
const doc = new Doc();
const test = doc.getArray('test');
const provider = new WebsocketProvider('ws://localhost:8888', 'rtc_yjs_test', doc);
const observe = (event) => console.log("OBSERVER:", event.changes);
test.observe(observe);
test.push([0,1,2,3,4]);
test.move(0, 2);
When using the new move feature from a Yjs client, If there is a Ypy client connected, the first client (the Yjs client that moved an element) receives an event undoing the move.
Everything works fine if there is not a Ypy client connected or if the client moving an element is a python client (Ypy) . I suspect the problem comes from my PR for the move feature #83, which I guess is missing handling a moving event coming from another client.
I have been looking into the code to see how Yrs or Ypy handles the events coming from other clients but I couldn't find anything. @Waidhoferj, @Horusiath or @dmonad do you know where should I look in the code to debug it?
Context
To reproduce the bug you can use a Yjs client like:
and a Ypy client like:
and you can start a WebSocket server with:
HOST=localhost PORT=8888 npx y-websocket
When the Yjs client moves an element it receives two events, the first event is the correct move of the element:
But the second event is reverting the move: