FR: Realtime DB Web Offline Write Persistence and Read Caching #7442
Open
Description
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.