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
Rust agentsagiaiai-memoryaudio-recordingcomputer-visionhermeshermes-agentllmlocal-ailocal-firstmachine-learningmcpmultimodalopenclawprivacyrewindscreen-recordingspeech-to-textycombinator
fix(permissions): auto-restart screenpipe after fixing permissions
Louis Beaumont034fff7e8931
diff --git a/screenpipe-app-tauri/app/permission-recovery/page.tsx b/screenpipe-app-tauri/app/permission-recovery/page.tsxindex cc5d3268e..a779a9ebe 100644--- a/screenpipe-app-tauri/app/permission-recovery/page.tsx+++ b/screenpipe-app-tauri/app/permission-recovery/page.tsx@@ -130,14 +130,27 @@ export default function PermissionRecoveryPage() {setJustFixed(newJustFixed);}- // Close window if all critical permissions are granted+ // Close window and restart screenpipe if all critical permissions are grantedif (screenOk && micOk) {- // Wait a moment to show success state+ // Wait a moment to show success state, then restart screenpipesetTimeout(async () => {try {+ // Restart screenpipe to resume recording+ console.log("Permissions fixed, restarting screenpipe...");+ await commands.stopScreenpipe();+ await commands.spawnScreenpipe(null);+ console.log("Screenpipe restarted successfully");++ // Close the modalawait commands.closeWindow("PermissionRecovery");} catch (error) {- console.error("Failed to close window:", error);+ console.error("Failed to restart screenpipe:", error);+ // Still close the modal even if restart fails+ try {+ await commands.closeWindow("PermissionRecovery");+ } catch (e) {+ console.error("Failed to close window:", e);+ }}}, 1500);}@@ -160,6 +173,16 @@ export default function PermissionRecoveryPage() {try {await commands.resetAndRequestPermission(permission);// The polling will detect when it's fixed+ // Add timeout fallback - if not fixed after 10s, clear the fixing state+ setTimeout(() => {+ setFixingPermission((current) => {+ if (current === permission) {+ console.log("Timeout: clearing fixing state for", permission);+ return null;+ }+ return current;+ });+ }, 10000);} catch (error) {console.error("Failed to reset permission:", error);setFixingPermission(null);diff --git a/screenpipe-app-tauri/src-tauri/Cargo.lock b/screenpipe-app-tauri/src-tauri/Cargo.lockindex 2f2c009cd..cd185de53 100755--- a/screenpipe-app-tauri/src-tauri/Cargo.lock+++ b/screenpipe-app-tauri/src-tauri/Cargo.lock@@ -5629,7 +5629,7 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"[[package]]name = "screenpipe-app"-version = "2.0.104"+version = "2.0.106"dependencies = ["anyhow","async-stream",