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: enable low-disk recording guard by default (#5810)

Louis Beaumont416c01dbe7e2
diff --git a/apps/screenpipe-app-tauri/components/settings/retention-settings.tsx b/apps/screenpipe-app-tauri/components/settings/retention-settings.tsx
index 994daac3b..5d39c3acd 100644
--- a/apps/screenpipe-app-tauri/components/settings/retention-settings.tsx
+++ b/apps/screenpipe-app-tauri/components/settings/retention-settings.tsx
@@ -435,8 +435,8 @@ export function RetentionSettings({
data-testid="low-disk-recording-guard-copy"
>
when free space falls to {lowDiskThreshold}, stop capture and
- notify you. search, scheduled tasks, and existing data stay available.
- off by default.
+ notify you. search, scheduled tasks, and existing data stay
+ available. on by default.
</p>
</div>
</div>
@@ -444,7 +444,7 @@ export function RetentionSettings({
id="stop-recording-on-low-disk"
data-testid="low-disk-recording-guard-toggle"
aria-label="stop recording before disk is full"
- checked={settings.stopRecordingOnLowDisk ?? false}
+ checked={settings.stopRecordingOnLowDisk ?? true}
onCheckedChange={(checked) =>
updateSettings({ stopRecordingOnLowDisk: checked })
}
diff --git a/apps/screenpipe-app-tauri/e2e/specs/brain-overview.spec.ts b/apps/screenpipe-app-tauri/e2e/specs/brain-overview.spec.ts
index 11054caad..bba9111bc 100644
--- a/apps/screenpipe-app-tauri/e2e/specs/brain-overview.spec.ts
+++ b/apps/screenpipe-app-tauri/e2e/specs/brain-overview.spec.ts
@@ -932,7 +932,6 @@ Refresh the assigned Live View output targets from source-backed activity.
const renderedText = (await browser.execute(
() => document.body?.innerText || "",
)) as string;
- expect(renderedText).toContain("Live Views");
expect(renderedText.toLowerCase()).toContain("dashboards");
expect(renderedText.toLowerCase()).toContain("customize");
expect(renderedText).toContain("Automation opportunities");
diff --git a/apps/screenpipe-app-tauri/e2e/specs/settings-sections.spec.ts b/apps/screenpipe-app-tauri/e2e/specs/settings-sections.spec.ts
index d8ea4507c..f8cd3e64b 100644
--- a/apps/screenpipe-app-tauri/e2e/specs/settings-sections.spec.ts
+++ b/apps/screenpipe-app-tauri/e2e/specs/settings-sections.spec.ts
@@ -255,14 +255,14 @@ describe('Settings sections', () => {
expect(existsSync(filepath)).toBe(true);
});
- it('keeps the low-disk guard off by default, then stops capture and persists a notification when enabled', async () => {
+ it('keeps the low-disk guard on by default, preserves explicit opt-out, and stops capture when enabled', async () => {
const navStorage = await $('[data-testid="settings-nav-storage"]');
await navStorage.click();
const toggle = await $('[data-testid="low-disk-recording-guard-toggle"]');
await toggle.waitForExist({ timeout: t(8_000) });
- expect(await toggle.getAttribute('data-state')).toBe('unchecked');
- expect(await invokeOrThrow<boolean>('e2e_low_disk_guard_enabled')).toBe(false);
+ expect(await toggle.getAttribute('data-state')).toBe('checked');
+ expect(await invokeOrThrow<boolean>('e2e_low_disk_guard_enabled')).toBe(true);
const config = await invokeOrThrow<{
thresholdBytes: number;
checkIntervalSeconds: number;
@@ -293,6 +293,18 @@ describe('Settings sections', () => {
// CaptureSession is torn down.
await invokeOrThrow('e2e_mark_capture_intended');
expect(await invokeOrThrow<boolean>('is_capture_paused')).toBe(false);
+
+ // An explicit user opt-out remains authoritative even though missing
+ // settings now fail safe to enabled.
+ await toggle.click();
+ await browser.waitUntil(
+ async () => !(await invokeOrThrow<boolean>('e2e_low_disk_guard_enabled')),
+ {
+ timeout: t(8_000),
+ interval: 200,
+ timeoutMsg: 'low-disk guard opt-out was not persisted',
+ },
+ );
expect(
await invokeOrThrow<string>('e2e_handle_disk_space_low', {
availableBytes: 1024 * 1024 * 1024,
@@ -356,7 +368,7 @@ describe('Settings sections', () => {
} finally {
// Leave the isolated E2E store at production defaults for later specs,
// including when an assertion above fails.
- await invokeOrThrow('e2e_set_low_disk_guard_enabled', { enabled: false });
+ await invokeOrThrow('e2e_set_low_disk_guard_enabled', { enabled: true });
await invokeOrThrow('e2e_set_notification_master_enabled', {
enabled: true,
});
diff --git a/apps/screenpipe-app-tauri/src-tauri/src/store.rs b/apps/screenpipe-app-tauri/src-tauri/src/store.rs
index 87004433b..a58892551 100644
--- a/apps/screenpipe-app-tauri/src-tauri/src/store.rs
+++ b/apps/screenpipe-app-tauri/src-tauri/src/store.rs
@@ -998,8 +998,8 @@ pub struct SettingsStore {
pub show_restart_notifications: bool,
/// Stop capture before the data volume is completely full. Search, pipes,
- /// and the local API remain available. Explicitly opt-in for now.
- #[serde(rename = "stopRecordingOnLowDisk", default)]
+ /// and the local API remain available. Safety-on unless explicitly disabled.
+ #[serde(rename = "stopRecordingOnLowDisk", default = "default_true")]
pub stop_recording_on_low_disk: bool,
/// When true, apply macOS vibrancy effect to the sidebar for a translucent look.
@@ -1471,7 +1471,7 @@ Rules:
show_overlay_in_screen_recording: false,
chat_always_on_top: true,
show_restart_notifications: false,
- stop_recording_on_low_disk: false,
+ stop_recording_on_low_disk: true,
#[cfg(target_os = "macos")]
translucent_sidebar: true,
#[cfg(not(target_os = "macos"))]
@@ -2193,21 +2193,21 @@ mod tests {
}
#[test]
- fn low_disk_recording_guard_defaults_to_disabled() {
- assert!(!SettingsStore::default().stop_recording_on_low_disk);
+ fn low_disk_recording_guard_defaults_to_enabled() {
+ assert!(SettingsStore::default().stop_recording_on_low_disk);
let missing: SettingsStore = serde_json::from_value(json!({
"aiPresets": []
}))
.unwrap();
- assert!(!missing.stop_recording_on_low_disk);
+ assert!(missing.stop_recording_on_low_disk);
- let opted_in: SettingsStore = serde_json::from_value(json!({
+ let opted_out: SettingsStore = serde_json::from_value(json!({
"aiPresets": [],
- "stopRecordingOnLowDisk": true
+ "stopRecordingOnLowDisk": false
}))
.unwrap();
- assert!(opted_in.stop_recording_on_low_disk);
+ assert!(!opted_out.stop_recording_on_low_disk);
}
#[test]
diff --git a/crates/screenpipe-secrets/src/migration.rs b/crates/screenpipe-secrets/src/migration.rs
index f72f26586..f0cd90ee4 100644
--- a/crates/screenpipe-secrets/src/migration.rs
+++ b/crates/screenpipe-secrets/src/migration.rs
@@ -366,6 +366,12 @@ mod tests {
)
.unwrap();
+ // SQLite stores updated_at with millisecond precision while APFS file
+ // mtimes have nanosecond precision. Keep the fixture unambiguously
+ // older so the second pass tests the already-migrated path instead of
+ // occasionally exercising the intentional newer-file re-import path.
+ tokio::time::sleep(std::time::Duration::from_millis(10)).await;
+
let store = make_store().await;
// First migration — file migrated (kept for legacy readers)