mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Merge branch 'bug/websocket-set-subscription' into 'dev'
self.clients was already a set. cannot subscript See merge request crafty-controller/crafty-4!467
This commit is contained in:
commit
372d8fff37
10
CHANGELOG.md
10
CHANGELOG.md
@ -1,13 +1,7 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
## --- [4.0.14] - 2022/TBD
|
## --- [4.0.14] - 2022/09/23
|
||||||
### New features
|
|
||||||
TBD
|
|
||||||
### Bug fixes
|
### Bug fixes
|
||||||
TBD
|
- HOTFIX - Rollback breaking websockets change !461 (self.clients was already a set and we tried to subscript a set of a set) ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/467))
|
||||||
### Tweaks
|
|
||||||
TBD
|
|
||||||
### Lang
|
|
||||||
TBD
|
|
||||||
<br><br>
|
<br><br>
|
||||||
|
|
||||||
## --- [4.0.13] - 2022/09/20
|
## --- [4.0.13] - 2022/09/20
|
||||||
|
@ -27,7 +27,7 @@ class WebSocketHelper:
|
|||||||
f"Sending to {len(self.clients)} clients: "
|
f"Sending to {len(self.clients)} clients: "
|
||||||
f"{json.dumps({'event': event_type, 'data': data})}"
|
f"{json.dumps({'event': event_type, 'data': data})}"
|
||||||
)
|
)
|
||||||
for client in self.clients[:]: # pylint: disable=unsubscriptable-object
|
for client in self.clients:
|
||||||
try:
|
try:
|
||||||
self.send_message(client, event_type, data)
|
self.send_message(client, event_type, data)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
@ -36,9 +36,6 @@ class WebSocketHelper:
|
|||||||
f"{client.get_remote_ip()} {e}"
|
f"{client.get_remote_ip()} {e}"
|
||||||
)
|
)
|
||||||
|
|
||||||
# Excempting 'unsubscriptable-object' warning as false positive from 'self' use
|
|
||||||
# Code has been tested by Andrew and functions as intended.
|
|
||||||
|
|
||||||
def broadcast_page(self, page: str, event_type: str, data):
|
def broadcast_page(self, page: str, event_type: str, data):
|
||||||
def filter_fn(client):
|
def filter_fn(client):
|
||||||
return client.page == page
|
return client.page == page
|
||||||
|
Loading…
Reference in New Issue
Block a user