Skip to content

Incorrect cache when querying documents. #7897

@KyleSmith0905

Description

@KyleSmith0905

Operating System

Windows 11

Browser Version

Chrome 120.0.6099.72

Firebase SDK Version

10.7.1

Firebase SDK Product:

Firestore

Describe your project's tooling

This bug has occurred in both of these tools:

  • Vite + React
  • Angular

Describe the problem

If you query query data on Firestore, it will use that data as a small local database as a cache. This may lead queries to return incorrect values in the cache.

This is almost never an expected behavior on the web. This leads to a flash of different content.

I'm using "onSnapshot" btw.

Steps and code to reproduce issue

I'm concurrently loading popular articles and latest articles. After some time I'm loading more latest articles.
Hosted site: https://mre--incorect-firestore-cache.web.app
Repository: https://github.com/KyleSmith0905/mre--incorrect-firebase-cache

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions