firebase / firebase/firebase-tools-ui

firestore emulator ui: clicking a 2nd collection attempts to load the last visited collections's first doc by default

Open
#1,046 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
291
Forks
74
PR merge metrics
No merged PRs in 30d

Description

### Environment info

**firebase-tools:**

11.25.3

**Platform:**

macOS Ventura 13.3.1 (22E261)

### Test case

Create a firestore database with at least 2 collections having at least 2 docs each, and follow the steps below.

### Steps to reproduce

1. Fire up the firestore emulator ui.
2. Click the name in the left hand side column of one of the collections, notice the first docId in the list.
3. Click the name of another collection, observe it uses the id of the first doc of the previous collection as default and thus fails to load the doc details (as that doc id doesn't exist in that collection). Clicking an existing doc id of the just clicked collection loads the doc fine.

This is only an issue with the initial load of the collection that has just been clicked, any doc being visited directly or by clicking their id loads the doc details perfectly fine.

### Expected behavior

Clicking a 2nd collection should load with its own first doc, and this load the doc details fine.

### Actual behavior

Clicking a 2nd collection loads it with the previously clicked collection's first doc, and thus fails to load anything (as that doc id doesn't exist in that collection).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.