Why don't I see data in the Firebase Cloud Firestore Emulator UI?

Viewed 1867

I have some tests for security rules and they prime up a dataset to the local Firestore emulator (using the @firebase/testing library, pretty much as described here). The tests mostly work, so I think the data really gets to Firestore.

But I cannot see it in the emulator UI.

http://localhost:4000/ > Firestore emulator > Go to emulator shows empty data

Related, I wonder what is the role of the ”project ID” parameter in emulation? It is required when setting up the Firebase app object, but where is it used? The emulator does not provide me a list of emulated projects, to pick from.

Confused.


Ways to replicate (as requested):

$ git clone git@github.com:akauppi/GroundLevel-es6-firebase-web.git
$ cd GroundLevel-es6-firebase-web/rules-test

# You only need to work in the rules-test subproject

$ npm install
...

In another terminal (same folder):

$ npm run start    # leave running...
$ npm run test:symbols

The tests should pass (one is skipped).

The running of the tests has primed data to the emulator, and it should still be there. Project id abc (see "Using session: abc" on the output).

http://localhost:4000/ > Go to emulator

Expected:

  • being able to select project abc
  • being able to see the primed data (btw. it's in data.js)

Actual:

  • there is no project id selection
  • there is no data

screenshot of Firestore emulator

I know too little to know, what's going on. Maybe @firebase/testing never reaches the emulator, and I should be using the normal Firebase client, instead?

1 Answers

The emulator UI only shows the active project, i.e. the one used in firebase use.

If tests use this project ID, their data is visible in the emulator. If they use some other, tests work but the emulator UI is out of the loop.

Not sure if this is by design or not. If you know a place in the documentation that addresses this, I'll be glad to mention it here.

firebase-tools 8.6.0

Related