diff --git a/assets/index.js b/assets/index.js index 5c89024..12fd160 100644 --- a/assets/index.js +++ b/assets/index.js @@ -30,7 +30,8 @@ function setupUi() { } function setupWs() { - ws.onclose = function () { + ws.onclose = function (e) { + console.log(e); setTimeout(() => { ws = new WebSocket(wsUrl); }, 2000); diff --git a/src/ws.rs b/src/ws.rs index 392aa9d..5b40644 100644 --- a/src/ws.rs +++ b/src/ws.rs @@ -56,6 +56,8 @@ async fn handle_socket(stream: WebSocket, state: Arc) { while let Some(Ok(Message::Text(text))) = receiver.next().await { if let Ok(action) = serde_json::from_str::(&text) { let client = action.client.clone(); + tracing::debug!("update from {}", client.clone()); + action.execute(state.clone()).await; let doc = state.doc.read().await;