Skip to content

Migrate conversation storage from localStorage to Firestore#5

Merged
phillsatellite merged 1 commit into
mainfrom
storageRefactor
Mar 10, 2026
Merged

Migrate conversation storage from localStorage to Firestore#5
phillsatellite merged 1 commit into
mainfrom
storageRefactor

Conversation

@phillsatellite

Copy link
Copy Markdown
Owner

Summary

  • Replaces localStorage conversation read/write with Firestore real-time sync
  • Conversations now persist across page refreshes and sync across devices
  • Uses onSnapshot listener on users/{uid}/conversations subcollection ordered by updatedAt desc
  • handleResult writes directly to Firestore; UI updates automatically via the listener

Firestore rules required

Update rules to use {document=**} wildcard to cover the new subcollection (see PR description).

- Replace two localStorage effects with a single onSnapshot listener
- Conversations now sync in real time across devices and survive refresh
- handleResult writes each conversation to users/{uid}/conversations/{convId}
- Subcollection ordered by updatedAt desc
@phillsatellite phillsatellite merged commit 1ff0ae8 into main Mar 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant