question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Saving database rules creates a new database on the emulator and applies the rules to it

See original GitHub issue

[REQUIRED] Environment info

firebase-tools: 8.4.2

Platform: Windows

[REQUIRED] Test case

https://github.com/filipesilva/firebase-rtdb-loglevel

[REQUIRED] Steps to reproduce

  • git clone https://github.com/filipesilva/firebase-rtdb-loglevel
  • cd firebase-rtdb-loglevel
  • npm i
  • npm run emulators
  • open http://localhost:4000/database, see the emulator-test-1 database
  • save database.rules.json once
  • in the emulator logs in the console, see the following lines:
i  database: Change detected, updating rules for undefined...
+  database: Rules updated.

[REQUIRED] Expected behavior

The rules should be applied to emulator-test-1 and no new database should be created.

[REQUIRED] Actual behavior

The rules are applied to a new database named undefined.

You can also change the code in public/index.html if you want to verify if the rules are applied to the correct database, but I was using the same reproduction for both this and https://github.com/firebase/firebase-js-sdk/issues/3211 and since this repro doesn’t actually need to run any database code, I left it as is.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
samtsterncommented, Jun 30, 2020

@karlmarxlopez no this will be included in the next release.

1reaction
samtsterncommented, Jun 17, 2020

@filipesilva thanks for the super-clear reproduction! I am working on this now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Understand Firebase Realtime Database Security Rules
The Firebase Realtime Database is schemaless. This makes it easy to change things as you develop, but once your app is ready to...
Read more >
Save data using SQLite - Android Developers
val db = dbHelper.writableDatabase // Create a new map of values, where column names are the keys val values = ContentValues().apply {
Read more >
Realtime database emulator ignores database.rules.json
i database: Change detected, updating rules for undefined... Apparently, doing this causes the emulator to create a new database called ...
Read more >
Unit testing security rules with the Firebase Emulator Suite
And there's no better subject to unit test than security rules, the main line of defense between your database and all of those ......
Read more >
Create Azure Cosmos DB resources from the Azure portal
Container IDs have the same character requirements as database names. Partition key, /category, The sample described in this article uses / ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found