Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

Bump app to v2.0.609

Louis Beaumont6e379f9de7ac
diff --git a/apps/screenpipe-app-tauri/src-tauri/Cargo.toml b/apps/screenpipe-app-tauri/src-tauri/Cargo.toml
index 5a9d05f5f..8cf2f41f1 100644
--- a/apps/screenpipe-app-tauri/src-tauri/Cargo.toml
+++ b/apps/screenpipe-app-tauri/src-tauri/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "screenpipe-app"
-version = "2.0.608"
+version = "2.0.609"
description = "24/7 memory for your desktop. 100% local."
authors = ["you"]
license = ""
diff --git a/crates/screenpipe-server/src/ui_recorder.rs b/crates/screenpipe-server/src/ui_recorder.rs
index 185a9ae17..68749495a 100644
--- a/crates/screenpipe-server/src/ui_recorder.rs
+++ b/crates/screenpipe-server/src/ui_recorder.rs
@@ -583,6 +583,8 @@ fn run_tree_walker(
}
if cache.should_store(&snap) {
+ // Check stop flag before blocking on the runtime — during shutdown
+ // the tokio context may be tearing down, causing a panic in block_on.
if stop.load(std::sync::atomic::Ordering::Relaxed) {
debug!("Stop flag set, skipping DB insert for accessibility text");
break;
@@ -590,21 +592,19 @@ fn run_tree_walker(
metrics.total_text_chars += snap.text_content.len() as u64;
- // Spawn the DB write on the runtime and wait via std channel.
- // Unlike block_on, this won't panic during runtime shutdown —
- // the spawned task is silently cancelled and the channel closes.
- let (result_tx, result_rx) = std::sync::mpsc::sync_channel(1);
- let db_c = db.clone();
- let app = snap.app_name.clone();
- let win = snap.window_name.clone();
- let text = snap.text_content.clone();
- let url = snap.browser_url.clone();
- rt_handle.spawn(async move {
- let r = db_c.insert_accessibility_text(&app, &win, &text, url.as_deref()).await;
- let _ = result_tx.send(r);
- });
-
- match result_rx.recv_timeout(std::time::Duration::from_secs(5)) {
+ // Wrap block_on in catch_unwind — during shutdown the tokio
+ // runtime may be tearing down, causing block_on to panic.
+ // Losing one DB write on shutdown is harmless.
+ let db_result = std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| {
+ rt_handle.block_on(db.insert_accessibility_text(
+ &snap.app_name,
+ &snap.window_name,
+ &snap.text_content,
+ snap.browser_url.as_deref(),
+ ))
+ }));
+
+ match db_result {
Ok(Ok(_id)) => {
debug!(
"Stored accessibility text: app={}, window={}, len={}, nodes={}, walk={}ms",
@@ -622,13 +622,8 @@ fn run_tree_walker(
metrics.walks_error += 1;
}
Err(_) => {
- // Channel closed (runtime shutdown) or timed out
- if stop.load(Ordering::Relaxed) {
- debug!("Runtime shutting down, stopping tree-walker DB writes");
- break;
- }
- debug!("DB insert timed out");
- metrics.walks_error += 1;
+ debug!("Runtime shutting down, stopping tree-walker DB writes");
+ break;
}
}
} else {