Skip to content

Refusing to open IndexedDB database due to potential corruption #9056

Open
@luke-rogers

Description

@luke-rogers

Operating System

iOS 18.*

Environment (if applicable)

Mobile Safari Version 16.1

Firebase SDK Version

11.6.1

Firebase SDK Product(s)

Firestore

Project Tooling

Angular

Detailed Problem Description

After the changes introduced in PR #8871, we’ve observed a significant number of IndexedDB initialization failures caused by this new conditional block:

if (
  this.lastClosedDbVersion !== null &&
  this.lastClosedDbVersion !== event.oldVersion
) {
  throw new Error(
    `refusing to open IndexedDB database due to potential ` +
      `corruption of the IndexedDB database data; this corruption ` +
      `could be caused by clicking the "clear site data" button in ` +
      `a web browser; try reloading the web page to re-initialize ` +
      `the IndexedDB database: ` +
      `lastClosedDbVersion=${this.lastClosedDbVersion}, ` +
      `event.oldVersion=${event.oldVersion}, ` +
      `event.newVersion=${event.newVersion}, ` +
      `db.version=${db.version}`
  );
}

This logic is now throwing for many first-time users of our app, particularly on iOS devices, where we see:

  • event.oldVersion = 0
  • lastClosedDbVersion = 17
  • event.newVersion = 17
  • db.version = 17

Impact

We’ve seen this error reported from 69 unique users, many of whom appear to be encountering it on first app open, likely with a fresh install. This completely blocks their ability to use the app, even though the database is likely in a clean state.

Steps and code to reproduce issue

We've been unable to reproduce it ourselves

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions