Skip to content

Commit

Permalink
fixed unexpected arg event_id in ws_send
Browse files Browse the repository at this point in the history
  • Loading branch information
visualDust committed Nov 25, 2023
1 parent 5649804 commit 9ce1de6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion neetbox/daemon/client/_action_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def __listen_to_actions(msg):
name=_action_name,
params=_action_args,
callback=lambda x: connection.ws_send(
event_type="action", payload={"name": _action_name, "result": x}, _event_id=_event_id
event_type="action", payload={"name": _action_name, "result": x}, event_id=_event_id
),
)

Expand Down
4 changes: 2 additions & 2 deletions neetbox/daemon/client/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def __on_ws_message(ws: websocket.WebSocketApp, msg):
f"Subscriber {name} crashed on message event {event_type_name}, ignoring."
)

def ws_send(event_type: str, payload):
def ws_send(event_type: str, payload, event_id=-1):
logger.debug(f"ws sending {payload}")
if ClientConn.__ws_client: # if ws client exist
ClientConn.__ws_client.send(
Expand All @@ -147,7 +147,7 @@ def ws_send(event_type: str, payload):
NAME_NAME_KEY: ClientConn._display_name,
EVENT_TYPE_NAME_KEY: event_type,
PAYLOAD_NAME_KEY: payload,
EVENT_ID_NAME_KEY: -1, # todo how does ack work
EVENT_ID_NAME_KEY: event_id,
}
)
)
Expand Down

0 comments on commit 9ce1de6

Please sign in to comment.