From a296492f7efe26111a06cce1f535916938997a1f Mon Sep 17 00:00:00 2001 From: cschen Date: Sat, 15 Feb 2025 19:50:51 +0100 Subject: [PATCH 1/3] adds version function to python type hints --- dist/py/src/codemp/codemp.pyi | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dist/py/src/codemp/codemp.pyi b/dist/py/src/codemp/codemp.pyi index aef51fb..4b0afdc 100644 --- a/dist/py/src/codemp/codemp.pyi +++ b/dist/py/src/codemp/codemp.pyi @@ -1,5 +1,7 @@ from typing import Tuple, Optional, Callable +def version() -> str: ... + class Driver: """ this is akin to a big red button with a white "STOP" on top of it. From 1f388b2eb46e13bc75e893b9097a907ec1c2f828 Mon Sep 17 00:00:00 2001 From: cschen Date: Sat, 15 Feb 2025 22:09:17 +0100 Subject: [PATCH 2/3] some rewording in the log messages --- src/ffi/python/client.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ffi/python/client.rs b/src/ffi/python/client.rs index 46bc033..90c12a6 100644 --- a/src/ffi/python/client.rs +++ b/src/ffi/python/client.rs @@ -31,14 +31,14 @@ impl Client { #[pyo3(name = "create_workspace")] fn pycreate_workspace(&self, py: Python<'_>, workspace: String) -> PyResult { - tracing::info!("attempting to create workspace {}", workspace); + tracing::info!("creating workspace {}", workspace); let this = self.clone(); a_sync_allow_threads!(py, this.create_workspace(workspace).await) } #[pyo3(name = "delete_workspace")] fn pydelete_workspace(&self, py: Python<'_>, workspace: String) -> PyResult { - tracing::info!("attempting to delete workspace {}", workspace); + tracing::info!("deleting workspace {}", workspace); let this = self.clone(); a_sync_allow_threads!(py, this.delete_workspace(workspace).await) } @@ -50,21 +50,21 @@ impl Client { workspace: String, user: String, ) -> PyResult { - tracing::info!("attempting to invite {user} to workspace {workspace}"); + tracing::info!("inviting {user} to workspace {workspace}"); let this = self.clone(); a_sync_allow_threads!(py, this.invite_to_workspace(workspace, user).await) } #[pyo3(name = "fetch_owned_workspaces")] fn pyfetch_owned_workspaces(&self, py: Python<'_>) -> PyResult { - tracing::info!("attempting to fetch owned workspaces"); + tracing::info!("fetching owned workspaces"); let this = self.clone(); a_sync_allow_threads!(py, this.fetch_owned_workspaces().await) } #[pyo3(name = "fetch_joined_workspaces")] fn pyfetch_joined_workspaces(&self, py: Python<'_>) -> PyResult { - tracing::info!("attempting to fetch joined workspaces"); + tracing::info!("fetching joined workspaces"); let this = self.clone(); a_sync_allow_threads!(py, this.fetch_joined_workspaces().await) } From ad1c5093b8d6975c76c0e32091adf348133335df Mon Sep 17 00:00:00 2001 From: cschen Date: Mon, 17 Feb 2025 21:54:11 +0100 Subject: [PATCH 3/3] changed the worker recognizing the closure of the controller from error to debug message. --- src/buffer/worker.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/buffer/worker.rs b/src/buffer/worker.rs index e5ee53b..9b6b434 100644 --- a/src/buffer/worker.rs +++ b/src/buffer/worker.rs @@ -115,7 +115,7 @@ impl BufferController { // received new change ack, merge editor branch up to that version res = worker.ack_rx.recv() => match res { - None => break tracing::error!("ack channel closed"), + None => break tracing::debug!("stopping: ack channel closed"), Some(v) => { tracing::debug!("client acked change"); worker.branch.merge(&worker.oplog, &v); @@ -126,7 +126,7 @@ impl BufferController { // received a new poller, add it to collection res = worker.poller.recv() => match res { - None => break tracing::error!("poller channel closed"), + None => break tracing::debug!("stopping: poller channel closed"), Some(tx) => worker.pollers.push(tx), }, @@ -213,10 +213,11 @@ impl BufferWorker { #[tracing::instrument(skip(self))] async fn handle_server_change(&mut self, change: BufferEvent) -> bool { match self.controller.upgrade() { - None => { // clean exit actually, just weird we caught it here + None => { + // clean exit actually, just weird we caught it here tracing::debug!("clean exit while handling server change"); true - }, + } Some(controller) => match self.oplog.decode_and_add(&change.op.data) { Ok(local_version) => { tracing::debug!("updating local version: {local_version:?}");