Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
rpicking opened this issue Dec 1, 2023 · 0 comments
Open

Comments

@rpicking
Copy link

rpicking commented Dec 1, 2023

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant