Skip to content

FR: Realtime DB Web Offline Write Persistence and Read Caching #7442

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
HazzMan2409 opened this issue Jul 11, 2023 · 2 comments
Open

FR: Realtime DB Web Offline Write Persistence and Read Caching #7442

HazzMan2409 opened this issue Jul 11, 2023 · 2 comments

Comments

@HazzMan2409
Copy link

Operating System

Any

Browser Version

Any

Firebase SDK Version

Any

Firebase SDK Product:

Database

Describe your project's tooling

N/A

Describe the problem

Every other client SDK (iOS, Android and Flutter) supports persisting data offline with the Realtime Database and so this statement in the documentation holds true.

However, the web with the JavaScript SDK has been left behind and swept under the rug:

  • it only supports persisting writes offline by keeping them stored in memory. If the process is closed or the browser reloads everything is gone.
  • reads are not cached at all, not in memory nor on disk. If you go offline, an onValue() that has been invoked before will not run. If you start offline, it's the same result.

I know the Realtime Database is not new and shiny like the FireStore but it should support these use cases and get parity with other SDKs so that the docs hold true.

Steps and code to reproduce issue

Run an onValue() offline or do a set() whilst offline after reloading your browser.

@HazzMan2409 HazzMan2409 added new A new issue that hasn't be categoirzed as question, bug or feature request question labels Jul 11, 2023
@jbalidiong jbalidiong added needs-attention and removed new A new issue that hasn't be categoirzed as question, bug or feature request labels Jul 12, 2023
@waseber
Copy link

waseber commented Aug 29, 2023

I'm experiencing the same issue: using persistentLocalCache on web, the indexedDB will store mutations on existing data items (update and delete)--if you close and reopen a browser it will sync with firestore. However addDoc or setDoc do not appear in the IndexedDB, thus after closing the browser/PWA while offline, the new data is lost.

@rockwotj
Copy link
Contributor

rockwotj commented Sep 7, 2024

dup of #17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants