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

fix: revert livetext to known-good state, always use HTTP for VisionKit, fix TDZ crash

Louis Beaumontc332ec8a7845
diff --git a/apps/screenpipe-app-tauri/components/rewind/hooks/use-live-text.ts b/apps/screenpipe-app-tauri/components/rewind/hooks/use-live-text.ts
index ed98d074d..e4985024d 100644
--- a/apps/screenpipe-app-tauri/components/rewind/hooks/use-live-text.ts
+++ b/apps/screenpipe-app-tauri/components/rewind/hooks/use-live-text.ts
@@ -100,9 +100,7 @@ export function useLiveText(opts: {
// For snapshot frames, use the local file path directly (instant).
// For video-chunk frames, fall back to HTTP endpoint (requires ffmpeg extraction).
- const imagePath = isSnapshotFrame && debouncedFrame.filePath
- ? debouncedFrame.filePath
- : `http://localhost:3030/frames/${debouncedFrame.frameId}`;
+ const imagePath = `http://localhost:3030/frames/${debouncedFrame.frameId}`;
// Position is managed exclusively by livetext_update_position.
// The analyze call only sets the analysis + shows the overlay.
diff --git a/apps/screenpipe-app-tauri/components/rewind/timeline.tsx b/apps/screenpipe-app-tauri/components/rewind/timeline.tsx
index f2919fdaf..cca747644 100644
--- a/apps/screenpipe-app-tauri/components/rewind/timeline.tsx
+++ b/apps/screenpipe-app-tauri/components/rewind/timeline.tsx
@@ -101,14 +101,6 @@ export default function Timeline({ embedded = false }: { embedded?: boolean }) {
// Stable guardRefs object for Live Text click guards — refs are stable, so useMemo with empty deps is fine
const guardRefs = useMemo(() => ({ filters: filtersRef, scrubber: scrubberRef }), []);
- // Force guard rect refresh when inner timeline mounts/unmounts
- useEffect(() => {
- // Slight delay to let DOM layout settle after inner timeline renders
- const timer = setTimeout(() => {
- window.dispatchEvent(new Event("resize"));
- }, 500);
- return () => clearTimeout(timer);
- }, [frames.length]);
const [startAndEndDates, setStartAndEndDates] = useState<TimeRange>(() => {
// Lazy init to avoid SSR/client hydration mismatch from new Date()
const now = new Date();
@@ -189,6 +181,13 @@ export default function Timeline({ embedded = false }: { embedded?: boolean }) {
const { meetings } = useMeetings(frames);
+ // Force guard rect refresh when inner timeline mounts/unmounts
+ useEffect(() => {
+ const timer = setTimeout(() => {
+ window.dispatchEvent(new Event("resize"));
+ }, 500);
+ return () => clearTimeout(timer);
+ }, [frames.length]);
// --- Extracted hooks ---
diff --git a/apps/screenpipe-app-tauri/src-tauri/src/pi.rs b/apps/screenpipe-app-tauri/src-tauri/src/pi.rs
index 92c1363a4..ed59b3a66 100644
--- a/apps/screenpipe-app-tauri/src-tauri/src/pi.rs
+++ b/apps/screenpipe-app-tauri/src-tauri/src/pi.rs
@@ -1400,7 +1400,7 @@ pub async fn pi_start_inner(
info!("Pi readiness signal received (pid: {})", pid);
}
_ = tokio::time::sleep(PI_READY_TIMEOUT) => {
- warn!("Pi readiness timeout after {:?} (pid: {}), checking if alive", PI_READY_TIMEOUT, pid);
+ debug!("Pi readiness timeout after {:?} (pid: {}), checking if alive", PI_READY_TIMEOUT, pid);
}
}
{
diff --git a/crates/screenpipe-core/src/pipes/mod.rs b/crates/screenpipe-core/src/pipes/mod.rs
index ab92fdd30..dd5e6135b 100644
--- a/crates/screenpipe-core/src/pipes/mod.rs
+++ b/crates/screenpipe-core/src/pipes/mod.rs
@@ -747,10 +747,10 @@ impl PipeManager {
pipes.insert(dir_name, (config, body, content));
}
Err(e) => {
- warn!("failed to parse {:?}: {}", pipe_md, e);
+ debug!("failed to parse {:?}: {}", pipe_md, e);
}
},
- Err(e) => warn!("failed to read {:?}: {}", pipe_md, e),
+ Err(e) => debug!("failed to read {:?}: {}", pipe_md, e),
}
}
diff --git a/crates/screenpipe-engine/src/event_driven_capture.rs b/crates/screenpipe-engine/src/event_driven_capture.rs
index 0f278e12b..5f7540301 100644
--- a/crates/screenpipe-engine/src/event_driven_capture.rs
+++ b/crates/screenpipe-engine/src/event_driven_capture.rs
@@ -454,7 +454,7 @@ pub async fn event_driven_capture_loop(
);
} else {
// Content dedup or window filter — capture skipped
- info!(
+ debug!(
"capture skipped DB write for monitor {} (trigger={})",
monitor_id,
trigger.as_str()
@@ -632,7 +632,7 @@ async fn do_capture(
let tree_snapshot = match tree_walk_result {
TreeWalkResult::Found(snap) => Some(snap),
TreeWalkResult::Skipped(reason) => {
- warn!(
+ debug!(
"skipping capture: window filtered ({}) on monitor {}",
reason, monitor_id
);
diff --git a/crates/screenpipe-engine/src/snapshot_compaction.rs b/crates/screenpipe-engine/src/snapshot_compaction.rs
index 0302e43e3..058e2213c 100644
--- a/crates/screenpipe-engine/src/snapshot_compaction.rs
+++ b/crates/screenpipe-engine/src/snapshot_compaction.rs
@@ -224,7 +224,31 @@ async fn compact_chunk(
break;
}
}
- dims.ok_or_else(|| anyhow::anyhow!("no readable JPEG found in chunk"))?
+ match dims {
+ Some(d) => d,
+ None => {
+ // All JPEGs gone/unreadable — clear stale DB pointers so we don't retry
+ let ids: Vec<i64> = frames.iter().map(|(id, _, _)| *id).collect();
+ debug!(
+ "snapshot compaction: clearing {} stale snapshot_path entries for {} (files missing)",
+ ids.len(),
+ device_name
+ );
+ for batch in ids.chunks(100) {
+ let placeholders: Vec<&str> = batch.iter().map(|_| "?").collect();
+ let sql = format!(
+ "UPDATE frames SET snapshot_path = NULL WHERE id IN ({})",
+ placeholders.join(",")
+ );
+ let mut query = sqlx::query(&sql);
+ for id in batch {
+ query = query.bind(id);
+ }
+ let _ = query.execute(&db.pool).await;
+ }
+ return Ok(None);
+ }
+ }
};
debug!(
@@ -253,7 +277,11 @@ async fn compact_chunk(
for (frame_id, snapshot_path, _) in frames {
let jpeg_path = Path::new(snapshot_path);
if !jpeg_path.exists() {
- warn!("snapshot file missing, skipping: {}", snapshot_path);
+ debug!("snapshot file missing, clearing DB pointer: {}", snapshot_path);
+ let _ = sqlx::query("UPDATE frames SET snapshot_path = NULL WHERE id = ?")
+ .bind(frame_id)
+ .execute(&db.pool)
+ .await;
continue;
}