Skip to content

Firestore Web creates thousands of records in localStorage until throws QuotaExceededError #9209

@victorwads

Description

@victorwads

Operating System

MacOs

Environment (if applicable)

Chrome 139.0.7258.128, React Web Production Build (https://finance.wads.dev/)

Firebase SDK Version

11.7.3

Firebase SDK Product(s)

Firestore

Project Tooling

Project Tooling

The app is built with the following tooling:

  • React + Vite + TS
  • Firebase Auth, Firestore

Detailed Problem Description

Problem description

During normal app usage, the browser started storing tens of thousands of keys in localStorage with the prefix:

firestore_mutations_firestore/[DEFAULT]/goldenunicornfc/...

I counted more than 37,711 entries of this type.
This quickly filled up the localStorage quota, making the app unusable (DevTools cannot even open the Storage tab, and any call to localStorage.setItem fails).

Additionally, a critical error is thrown in the console:

index-CoKaw0am.js:910 Uncaught Error: FIRESTORE (11.9.0) INTERNAL ASSERTION FAILED: Unexpected state (ID: b815) 
CONTEXT: {"cc":"QuotaExceededError: Failed to execute 'setItem' on 'Storage': 
Setting the value of 'firestore_clients_firestore/[DEFAULT]/goldenunicornfc/_5aPCl5rs55dDzPdHvpj9' exceeded the quota.
    at oh.setItem (...)
    at oh.uo (...)
    at oh.addLocalQueryTarget (...)
    at DO (...)
    at async cb1 (...)
    at async SO (...)"}

Expected behavior (I think)

localStorage-dump-finance-wads-dev-2025-08-17T03-24-42-197Z.json

  • Firestore should primarily use IndexedDB for offline persistence.
  • localStorage should only contain a small number of control keys, not tens of thousands.
  • Processed mutation records should be properly cleared.

Steps and code to reproduce issue

Additional details

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions