NilCoalescing / djangochannelsrestframework

A Rest-framework for websockets using Django channels-v4
https://djangochannelsrestframework.readthedocs.io/en/latest/
MIT License
613 stars 86 forks source link

Question about client notify #161

Closed tyctor closed 1 year ago

tyctor commented 1 year ago

Hi

first thank you for this module.

I use @model_observer to notify clients about model changes the message is sent to all clients, is there some way to avoid sending the message to the client which made that change? because that client has already received same data in the CRUD response

thanks for any hint

johnthagen commented 1 year ago

When I do this with bare django-channels, I generate a UUID in the connect() method and save it to the instances state (e.g. self.id). That way the session ID can be compared when sending responses and filtered to avoid looping back to the same client.