Skip to content

Electron storage settings

Historical context: this page was written while the Electron and Tauri apps coexisted. Mentions of Tauri helpers, pages, tests and regression results describe that migration period; the Tauri shell has since been removed and the shared code now lives in electron/src/shared/. Existing Tauri installs: see the migration guide.

Settings > Storage reads the existing cached disk report, shows volume use/free space, model cache, application data, engine environments and temporary files, and marks incomplete scans explicitly. Largest models and data subtotals expand inline. Warning formatting and byte formatting are shared with Tauri.

Open folder uses Electron's native reveal bridge, with the existing backend reveal route for browser development. Model and log links open their existing management views. Temporary-file cleanup requires explicit confirmation with the running-job warning. A partial deletion reports failure instead of claiming all files were cleared, and refreshes usage. Opening the page never deletes anything.

Database backup status displays the latest pre-migration snapshot and date. This is database backup information, not a claim that source media and generated files are backed up. History retention reuses the confirmed cap editor from Privacy.

The model cache location uses Electron's native directory picker. Main verifies the directory is writable, stores a one-shot models_dir capability in the backend data directory, and returns only its token to the renderer. The backend consumes that token when persisting OMNIVOICE_CACHE_DIR; raw host paths never cross the HTTP boundary. Reset uses the same capability flow with an empty path, and either change takes effect after restart.

Reset & remove provides four common presets and an advanced per-scope list with measured disk sizes. The renderer owns UI preferences, history, drafts and IndexedDB projects. Main owns settings, generated content, engines, tools, models, caches and logs; it accepts only known scopes from the trusted main frame, rejects remote-backend resets and unsafe roots, stops the local backend before deletion and restarts it afterward. Removing voices/projects/audio requires typing the localized confirmation word. Shared Hugging Face caches carry a separate warning. A model folder counts as VoiceStudio's own only when it sits strictly inside the app data folder; the same folder reached under two roles (data and models pointing at one place through a link, case or trailing-slash alias) stays shared. Models never removes a folder that is or holds the app data or logs, and no other scope removes a folder that holds the model cache unless Models is also selected; sizes count a nested cache once, under Models. Pending draft writes are suspended before reload so deleted work cannot be recreated by pagehide persistence.

The application data location uses Electron's native folder picker and a main-process one-shot authorization. Relocation stops the managed local backend, copies and verifies every file into an empty destination, atomically persists OMNIVOICE_DATA_DIR in the shared durable environment, restarts the backend and confirms /system/info advertises the new path before removing the old copy. Preparation cleanup preserves a replaced staging root; before identity verification it can remove only an empty scratch folder. The source and destination cannot contain one another. Moving or replacing the selected folder, including retargeting an alias, cancels relocation and keeps the original data. Existing empty destinations, including mounted drives, keep their directory identity and need no write access to their parent; free space is checked on the selected filesystem. A failed copy or activation attempts to restore the previous setting and restart from the original folder. Rollback in an existing destination checks exact file identity, creation/change metadata and copied content before deleting entries, preserving concurrent additions or replacements, including inside its temporary transaction folder. Filesystems without usable stable directory creation identity are rejected before copying; ambiguous timestamps are checked with an empty, exclusively owned marker before any model data is copied. A narrow handoff recognizes the backend's startup cache-index update before rollback. Modified or rotated logs and any other uncertain files remain for inspection; if cleanup, setting restoration or engine restart cannot finish, the UI reports incomplete recovery and asks the user to check the engine and destination before retrying with an empty folder. If the attempted backend cannot be stopped, cleanup keeps the destination intact. If final old-folder cleanup fails, the new location stays active and the UI tells the user that the old copy can be removed manually. Remote and separately started backends are rejected because Electron cannot freeze their writes safely.

Remove all data scans the backend data root, Electron runtime/configuration, logs, durable environment and model cache with real sizes. Shared Hugging Face caches, including a cache that is the same folder as the data or runtime folder, remain an explicit opt-in. After typed confirmation, main rescans and validates every root, stops the backend and hands the exact plan to the signed desktop helper. The helper canonicalizes every path, waits for Electron to exit, then removes the locked Chromium/runtime tree without following a path alias outside VoiceStudio-owned data. A failed helper launch restores the backend and keeps the app open; a successful handoff quits immediately. Removing the installed application binary remains the operating system's normal uninstall step.

electron/tests/storage-settings-smoke.mjs verifies warning/partial-scan display, folder reveal, cancel/confirm cleanup, partial cleanup failure and backup status with mocked mutations. Live read-only reports returned all four categories, one volume and an existing backup. No actual files were deleted. Tauri storage regression tests pass after shared-helper extraction. Connection, performance and privacy browser tests also pass after the settings-navigation refactor.

Interrupted sidecar installs without an environment remain included in application data. Completed sidecar environments, checkouts and weights are counted once in the engine category.

An unreadable engine directory or entry produces an incomplete report and a warning; unavailable bytes are not presented as a complete empty footprint.

Markdown source: View on AtomGit·Content from the open-source project om/VoiceStudio