Skip to content

Firestore error link points to wrong database when using Named Databases #9357

@Fernando-Villela-CBTKD

Description

@Fernando-Villela-CBTKD

Operating System

Ubuntu 24.04

Environment (if applicable)

Chrome 141.0.7390.122; react.js 19.2.0

Firebase SDK Version

12.4.0

Firebase SDK Product(s)

Firestore

Project Tooling

React App

Detailed Problem Description

When using Named Databases, the error link generated by Firestore for missing composite indexes points to the default database instead of the Named Database.

Environment:

  • firebase: 12.4.0
  • Platform: Web (JavaScript SDK)
  • Feature: Named Databases

Steps to reproduce:

  1. Create a Named Database (e.g., "cbtkdeventos")
  2. Initialize Firestore with Named Database: getFirestore(app, 'cbtkdeventos')
  3. Execute a query that requires a composite index
  4. The error link uses /v1/r/project/.../databases/cbtkdeventos/... which incorrectly opens the default database

Expected behavior:
The link should use /u/0/project/.../databases/cbtkdeventos/... to open the correct Named Database

Workaround:
Manually replace /v1/r/ with /u/0/ in the error URL

Steps and code to reproduce issue


Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions