mirror of
https://github.com/thilo-behnke/wasm-pong.git
synced 2026-07-11 02:29:25 +00:00
investigating issue with failed heartbeat persists
This commit is contained in:
@@ -107,7 +107,8 @@ function createNetworkEvents() {
|
||||
return;
|
||||
}
|
||||
console.debug("producing message to ws: ", message);
|
||||
ws.send(JSON.stringify(message));
|
||||
// TODO: Hotfix, double serialize to ease deserialization on server.
|
||||
ws.send(JSON.stringify({msg_type: message.msg_type, payload: JSON.stringify(message.payload)}));
|
||||
}
|
||||
|
||||
function produce(snapshot: SessionSnapshot) {
|
||||
|
||||
@@ -430,7 +430,7 @@ fn write_events<T>(events: Vec<T>, topic: &str, event_writer: &mut SessionWriter
|
||||
for event in events {
|
||||
let serialized = serde_json::to_string(&event);
|
||||
if let Err(e) = serialized {
|
||||
eprintln!("Failed to serialize event {:?} in topic {}: {:?}", event, topic, e);
|
||||
error!("Failed to serialize event {:?} in topic {}: {:?}", event, topic, e);
|
||||
any_error = true;
|
||||
continue;
|
||||
}
|
||||
@@ -441,7 +441,7 @@ fn write_events<T>(events: Vec<T>, topic: &str, event_writer: &mut SessionWriter
|
||||
let to_send = to_send.iter().map(|e| e.as_str()).collect();
|
||||
let write_res = event_writer.write_to_session(topic, to_send);
|
||||
if let Err(e) = write_res {
|
||||
eprintln!("Failed to write at least one event to topic {}: {:?}", topic, e);
|
||||
error!("Failed to write at least one event to topic {}: {:?}", topic, e);
|
||||
any_error = true;
|
||||
}
|
||||
return any_error;
|
||||
|
||||
Reference in New Issue
Block a user