[RTDB] Wrong "Non-default "firebase-admin" instance created!" message #2670
Open
Description
[REQUIRED] Environment info
firebase-tools: 8.11.2
Platform: Ubuntu 20.04
[REQUIRED] Test case
Unfortunately I am in a rush to finish my app and I can't fill this issue correctly, and my project is currently fairly big and close to the prod to be safely published here. As the issue pointed here isn't a big deal and won't halt my development, I really won't invest more time on it.
[REQUIRED] Steps to reproduce
- Have an emulator that uses more than one Realtime Database instances that are correctly set under .firebaserc:
{
"projects": {
"default": myProjectName
},
"targets": {
myProjectName: {
"database": {
"instances": [
"myInstance-0", // (not real name)
...1 etc
-
Run the emulator, and all the instances appear there correctly (Also appear an instance named just "0", but I may open an issue for that later).
-
Have in your code the instance initialization
const dbs[dbId] = firebase.database(firebase.initializeApp({
databaseURL: `https://myInstance-${dbId}.firebaseio.com/`
}, dbId)));
- The warning will pop:
Non-default "firebase-admin" instance created!
[1] - This instance will *not* be mocked and will access production resources.
- However, when setting any data to this Realtime Database instance, it will ONLY appear in the emulator UI as it should happen, and my prod DB is intact. So, this warn is NOT true and shouldn't appear.
[REQUIRED] Expected behavior
This warn shouldn't appear if the data is going to the emulator DB.
[REQUIRED] Actual behavior
This warn shouldn't appear if the data is going to the emulator DB.
Sorry for not filling correctly this Issue.