-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Add Cross-Browser Conversation Persistence with Remote Storage
Description
Currently, Polyglot saves all conversations only in localStorage, which makes them browser- and device-specific. This approach is brittle and limits the user experience: conversations are lost if the user clears their browser data or switches devices.
We want to implement persistent, cross-browser storage while keeping localStorage as a cache for speed. This would allow users to access their conversation history from any device or browser where they log in.
Acceptance Criteria
-
Remote Persistence
- Save conversation history to a server-side database (could start with a simple REST API or Firebase/Firestore).
- Associate conversations with a unique user ID or session token.
-
Local Cache
- Continue caching conversations in
localStoragefor fast access. - Sync changes between local cache and remote storage.
- Continue caching conversations in
-
Sync Logic
- On app load, fetch the latest conversation history from the server and populate
localStorage. - Handle conflicts between local and remote versions gracefully (e.g., last-write-wins or merge strategies).
- On app load, fetch the latest conversation history from the server and populate
-
Cross-Browser Support
- Conversations should persist across multiple browsers and devices.
- Implement authentication or a device/session token system to identify users.
-
Error Handling
- Offline usage should still be possible via
localStorage. - Sync retries if network fails.
- Offline usage should still be possible via
-
Future-Proofing
- Design storage schema so additional features (conversation tags, search, export) can be added easily.
Notes
- Consider using lightweight solutions initially (Firebase, Supabase, or a simple Node.js backend with SQLite/Postgres).
- Make sure performance is optimized: fetching hundreds of conversations should not noticeably slow down the app.
Labels
enhancement
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels