Session Management & Persistence - Incomplete-Infinity/eve-companion GitHub Wiki
🧷 Session Management & Persistence
The EVE Companion App supports persistent, resumable sessions across modules, including login states, active windows, and cached data.
🔐 Session Storage Scope
Sessions include:
- Auth tokens and refresh tokens (if applicable)
- Active character and last-used corp/alliance context
- Open windows/modules and their state
- Recent fits, messages, and settings
- Dexie-stored datasets (e.g., market cache, ESI lookups)
📦 Storage Layers
Layer | Used For |
---|---|
electron-store | Settings, login persistence, local preferences |
Dexie.js | Large datasets, cached endpoints, historical logs |
Memory | Ephemeral data, short-term UI state |
🔄 Session Load/Save Flow
- App starts
electron-store
provides initial state snapshot- Dexie loads persisted data (market, fits, skills)
- Zustand stores hydrate on top
- UI restores open windows, layouts, selections
🧼 Logout & Session Reset
Logging out clears:
- All
electron-store
entries tied to user - Dexie tables related to the previous session
- Auth tokens (explicitly revoked if needed)
- UI state (windows reset, data purged, events cleared)
🛠 Planned Enhancements
- Multi-user local switching
- “Resume Last Session” with auto-launch toggle
- Session-scoped event logging for diagnostics
- Encrypted session persistence (with passphrase unlock)