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
Revert "fix: skip auto-update install for non-admin macOS users"
Louis Beaumontb49cb79bdc4e
diff --git a/apps/screenpipe-app-tauri/components/update-banner.tsx b/apps/screenpipe-app-tauri/components/update-banner.tsxindex 662538f90..760dc296d 100644--- a/apps/screenpipe-app-tauri/components/update-banner.tsx+++ b/apps/screenpipe-app-tauri/components/update-banner.tsx@@ -30,10 +30,6 @@ interface AuthRequiredInfo {message: string;}-interface NeedsAdminInfo {- version: string;-}-interface UpdateBannerState {isVisible: boolean;updateInfo: UpdateInfo | null;@@ -42,7 +38,6 @@ interface UpdateBannerState {downloadProgress: DownloadProgress | null;pendingUpdate: Update | null;authRequired: AuthRequiredInfo | null;- needsAdmin: NeedsAdminInfo | null;setIsVisible: (visible: boolean) => void;setUpdateInfo: (info: UpdateInfo | null) => void;setIsInstalling: (installing: boolean) => void;@@ -50,7 +45,6 @@ interface UpdateBannerState {setDownloadProgress: (progress: DownloadProgress | null) => void;setPendingUpdate: (update: Update | null) => void;setAuthRequired: (info: AuthRequiredInfo | null) => void;- setNeedsAdmin: (info: NeedsAdminInfo | null) => void;}export const useUpdateBanner = create<UpdateBannerState>((set) => ({@@ -61,7 +55,6 @@ export const useUpdateBanner = create<UpdateBannerState>((set) => ({downloadProgress: null,pendingUpdate: null,authRequired: null,- needsAdmin: null,setIsVisible: (visible) => set({ isVisible: visible }),setUpdateInfo: (info) => set({ updateInfo: info }),setIsInstalling: (installing) => set({ isInstalling: installing }),@@ -69,7 +62,6 @@ export const useUpdateBanner = create<UpdateBannerState>((set) => ({setDownloadProgress: (progress) => set({ downloadProgress: progress }),setPendingUpdate: (update) => set({ pendingUpdate: update }),setAuthRequired: (info) => set({ authRequired: info }),- setNeedsAdmin: (info) => set({ needsAdmin: info }),}));interface UpdateBannerProps {@@ -79,7 +71,7 @@ interface UpdateBannerProps {export function UpdateBanner({ className, compact = false }: UpdateBannerProps) {const isEnterprise = useIsEnterpriseBuild();- const { isVisible, updateInfo, isInstalling, isDownloading, downloadProgress, setIsVisible, setIsInstalling, pendingUpdate, authRequired, setAuthRequired, needsAdmin, setNeedsAdmin } = useUpdateBanner();+ const { isVisible, updateInfo, isInstalling, isDownloading, downloadProgress, setIsVisible, setIsInstalling, pendingUpdate, authRequired, setAuthRequired } = useUpdateBanner();const { toast } = useToast();if (isEnterprise) return null;@@ -197,41 +189,6 @@ export function UpdateBanner({ className, compact = false }: UpdateBannerProps));}- // Show needs-admin state — macOS non-admin users need admin to install- if (needsAdmin) {- if (compact) {- return (- <div className={cn("flex items-center gap-2 text-xs text-muted-foreground", className)}>- <Sparkles className="h-3 w-3 text-primary" />- <span>v{needsAdmin.version} available (admin needed)</span>- </div>- );- }- return (- <div className={cn(- "flex items-center justify-between gap-3 px-3 py-2 bg-muted/50 border-b text-sm",- className- )}>- <div className="flex items-center gap-2 flex-1">- <Sparkles className="h-4 w-4 text-primary" />- <span>- screenpipe <span className="font-medium">v{needsAdmin.version}</span> is available — ask your admin to install it- </span>- </div>- <div className="flex items-center gap-2">- <Button- variant="ghost"- size="sm"- className="h-7 w-7 p-0"- onClick={() => setNeedsAdmin(null)}- >- <X className="h-4 w-4" />- </Button>- </div>- </div>- );- }-// Show downloading state even before updateInfo is setif (isDownloading && !updateInfo) {const pct = downloadProgress?.percent ?? 0;@@ -342,7 +299,7 @@ export function UpdateBanner({ className, compact = false }: UpdateBannerProps)// Hook to listen for update events from Rustexport function useUpdateListener() {- const { setIsVisible, setUpdateInfo, setIsDownloading, setDownloadProgress, setAuthRequired, setNeedsAdmin } = useUpdateBanner();+ const { setIsVisible, setUpdateInfo, setIsDownloading, setDownloadProgress, setAuthRequired } = useUpdateBanner();useEffect(() => {let unlistenAvailable: (() => void) | undefined;@@ -350,7 +307,6 @@ export function useUpdateListener() {let unlistenDownloading: (() => void) | undefined;let unlistenProgress: (() => void) | undefined;let unlistenAuth: (() => void) | undefined;- let unlistenNeedsAdmin: (() => void) | undefined;const setupListeners = async () => {// Listen for download starting (shows banner immediately)@@ -384,12 +340,6 @@ export function useUpdateListener() {setIsDownloading(false);setDownloadProgress(null);});-- unlistenNeedsAdmin = await listen<NeedsAdminInfo>("update-needs-admin", (event) => {- setNeedsAdmin(event.payload);- setIsDownloading(false);- setDownloadProgress(null);- });};setupListeners();@@ -400,7 +350,6 @@ export function useUpdateListener() {unlistenDownloading?.();unlistenProgress?.();unlistenAuth?.();- unlistenNeedsAdmin?.();};- }, [setIsVisible, setUpdateInfo, setIsDownloading, setDownloadProgress, setAuthRequired, setNeedsAdmin]);+ }, [setIsVisible, setUpdateInfo, setIsDownloading, setDownloadProgress, setAuthRequired]);}diff --git a/apps/screenpipe-app-tauri/src-tauri/src/updates.rs b/apps/screenpipe-app-tauri/src-tauri/src/updates.rsindex b55022983..82d404613 100644--- a/apps/screenpipe-app-tauri/src-tauri/src/updates.rs+++ b/apps/screenpipe-app-tauri/src-tauri/src/updates.rs@@ -24,40 +24,6 @@ use tokio::sync::oneshot;use tokio::sync::Mutex;use tokio::time::interval;-use std::sync::OnceLock;--static IS_MACOS_ADMIN: OnceLock<bool> = OnceLock::new();--pub fn is_macos_admin() -> bool {- *IS_MACOS_ADMIN.get_or_init(|| {- #[cfg(target_os = "macos")]- {- if let Ok(output) = std::process::Command::new("id").arg("-Gn").output() {- if let Ok(groups) = String::from_utf8(output.stdout) {- return groups.split_whitespace().any(|g| g == "admin");- }- }- false- }- #[cfg(not(target_os = "macos"))]- {- true- }- })-}--#[cfg(test)]-mod tests {- use super::*;-- #[test]- fn test_is_macos_admin_executes() {- // Just verify it doesn't panic- let is_admin = is_macos_admin();- println!("is_macos_admin: {}", is_admin);- }-}-// ---------------------------------------------------------------------------// Rollback: download a specific older version from R2 via the website API// ---------------------------------------------------------------------------@@ -103,10 +69,6 @@ pub async fn install_specific_version(app: &tauri::AppHandle, version: &str) ->info!("rollback: downloading v{}", version);- if !is_macos_admin() {- return Err("rollback requires admin privileges on macOS. please run screenpipe as admin to rollback.".to_string());- }-update.download_and_install(|_, _| {}, || {}).await@@ -286,34 +248,6 @@ impl UpdatesManager {if let Some(update) = check_result? {*self.update_available.lock().await = true;- if !is_macos_admin() {- warn!("skipping auto-update: user is not a macOS admin");- let _ = self.app.emit(- "update-needs-admin",- serde_json::json!({- "version": update.version- }),- );-- let app_notif = self.app.clone();- let version_str = update.version.clone();- let _ = std::thread::spawn(move || {- let _ = app_notif- .notification()- .builder()- .title("screenpipe update available")- .body(format!("update v{} available — ask your admin to install it", version_str))- .show();- });-- if let Some(ref item) = self.update_menu_item {- item.set_enabled(false)?;- item.set_text(&format!("ask admin to update v{}", update.version))?;- }-- return Ok(false);- }-// Emit "update-downloading" immediately so user sees feedbacklet download_info = serde_json::json!({"version": update.version,