yjs / y-websocket

Websocket Connector for Yjs
https://docs.yjs.dev/ecosystem/connection-provider/y-websocket
MIT License
467 stars 251 forks source link

Can't get text data on server #167

Closed rodshtein closed 5 months ago

rodshtein commented 5 months ago

Packages

y-protocols: 1.0.6 y-websocket: 1.5.3 yjs: 13.6.10 ws: 8.16.0

node: 18.18.2

Description

It's almost last node server implementation, i just add couple string to log events:

image

… and i get nothing (sync works fine anyway):

image

i even tried HTTP callback with same result:

image

But for Array all works fine:

image

dmonad commented 5 months ago

I can't reproduce the issue with this little information.

I guess that when you debug the issue yourself you will find that 'code' is not a Y.Text on the client-side...

dmonad commented 5 months ago

Try changing getText to getArray

rodshtein commented 5 months ago

@dmonad

On client side it's definitely Text. It's Codemirror binding

image

And i tried to use shadow doc — and all works fine. Looks like bug for me

image image

rodshtein commented 5 months ago

Ok, json works, but why? Why text type become json, and then Text again? image image

dmonad commented 5 months ago

I don't know how you modified the code. The issue is not reproducible. My guess is that it has something to do with the hooks you set up

rodshtein commented 5 months ago

Hm, i don't use any hooks, it's almost a pure r&d project. Ok, i will try to reproduce it without ui framework. Will back soon.