-
Notifications
You must be signed in to change notification settings - Fork 0
Persistence and Storage
JRC uses two persistence layers: electron-store for long-term configuration and sessionStorage for per-session console logs.
electron-store wraps a JSON file on disk with schema validation. JRC uses it to persist profiles and settings.
| OS | Path |
|---|---|
| Windows | %APPDATA%\java-runner-client\java-runner-config.json |
| Linux | ~/.config/java-runner-client/java-runner-config.json |
| macOS | ~/Library/Application Support/java-runner-client/java-runner-config.json |
interface StoreSchema {
profiles: Profile[]
settings: AppSettings
}getAllProfiles(): Profile[]
saveProfile(profile: Profile): void // upsert; stamps updatedAt server-side
deleteProfile(id: string): void
getSettings(): AppSettings // merged with DEFAULT_SETTINGS
saveSettings(settings: AppSettings): voidgetSettings() always returns a complete AppSettings object. It spreads DEFAULT_SETTINGS first then the stored value, so adding new settings fields in future releases will not break configs written by older versions.
const DEFAULT_SETTINGS: AppSettings = {
launchOnStartup: false,
startMinimized: false,
minimizeToTray: true,
consoleFontSize: 13,
consoleMaxLines: 5000,
consoleWordWrap: false,
consoleLineNumbers: false,
consoleHistorySize: 200,
theme: 'dark',
}The JSON file can be edited manually while JRC is closed. Changes take effect on next launch. Corrupt JSON will cause electron-store to reset to defaults.
Console output lines are stored in sessionStorage to survive React re-renders, hot-module replacement, and route changes without requiring another IPC round-trip.
jrc:console:<profileId>
Example: jrc:console:550e8400-e29b-41d4-a716-446655440000
- Written after every
APPEND_LOGdispatch viasaveLogs(id, lines) - Read on
AppProvidermount for each profile vialoadLogs(id, max) - Deleted on
CLEAR_LOGand on profile deletion - Content is trimmed to
settings.consoleMaxLinesbefore saving - Automatically cleared by the browser when the Electron window is closed (sessionStorage is not persisted to disk by Chromium in Electron)
The process activity log (processManager.activityLog) is an in-memory array. It is not written to disk and is lost when the app closes. Maximum 500 entries; oldest are dropped when the limit is exceeded.