Skip to content

Commit

Permalink
Apply awareness updates to server awareness
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbrochart committed Oct 9, 2024
1 parent 826446f commit 7edc68e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pycrdt_websocket/yroom.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
create_sync_message,
create_update_message,
handle_sync_message,
read_message,
)

from .websocket import Websocket
Expand Down Expand Up @@ -302,6 +303,8 @@ async def serve(self, websocket: Websocket):
client.path,
)
tg.start_soon(client.send, message)
# apply awareness update to the server's awareness
self.awareness.apply_awareness_update(read_message(message[1:]))
# remove this client
self.clients.remove(websocket)
except Exception as exception:
Expand Down

0 comments on commit 7edc68e

Please sign in to comment.