Fix handling of empty payloads in websocket client (#7838)
This commit is contained in:
@@ -57,6 +57,11 @@ class ws_client {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// No pending request and empty payload is dropped
|
||||||
|
if (switch_event == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Otherwise it's a server‑pushed event…
|
// Otherwise it's a server‑pushed event…
|
||||||
// e.g. env.service === 'event' or env.topic is your event name
|
// e.g. env.service === 'event' or env.topic is your event name
|
||||||
this._dispatchEvent(message.service_name, switch_event);
|
this._dispatchEvent(message.service_name, switch_event);
|
||||||
|
|||||||
Reference in New Issue
Block a user