ypy icon indicating copy to clipboard operation
ypy copied to clipboard

Changes made in a transaction to a YText do not get synced to clients

Open rpicking opened this issue 8 months ago • 0 comments

I'm currently struggling to update a shared text to update on connected clients. Things seem to work perfectly normal when the changes come via a connected client, but the change to the shared type from the ypy websocket server's shared type are not propagated.

Newly connected clients do get the correct state upon connection, but an sharedType.observe will never be triggered.

The snippet below is how I am updating the YText. When the room is connected I get the text from the yDoc via yText = self.yDoc.get_text('name')

with doc.begin_transaction() as txn:
    yText.insert(txn, 0, 'hello world')

I would expect this to update cause all connected clients in the room's shared type gotten from name to trigger their observe callbacks.

Is this the correct way to update a shared type on the python side? Am I potentially doing something else wrong?

rpicking avatar Dec 01 '23 01:12 rpicking