mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 01:57:35 -03:30
add websocket group unsubscribe reply
* This change adds more than just an unsubscribe reply. * Websockets canrequest to join/leave groups. They do so using a single idempotent request. This change replies to group requests over the websockets with the diff of the group subscription. i.e. what groups the user currenntly is in, what groups were left, and what groups were joined.
This commit is contained in:
parent
088373963b
commit
feac93fd24
@ -204,6 +204,11 @@ class EventConsumer(AsyncJsonWebsocketConsumer):
|
||||
)
|
||||
logger.debug(f"Channel {self.channel_name} left groups {old_groups} and joined {new_groups_exclusive}")
|
||||
self.scope['session']['groups'] = new_groups
|
||||
await self.send_json({
|
||||
"groups_current": list(new_groups),
|
||||
"groups_left": list(old_groups),
|
||||
"groups_joined": list(new_groups_exclusive)
|
||||
})
|
||||
|
||||
async def internal_message(self, event):
|
||||
await self.send(event['text'])
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user