Note to myself when deploying to firebase

When developing Angular app with firebase, I usually update the database security rules in the firebase dashboard. Here’s a sample

 

Here I allow the reading of data in my “users” node so that it can be access by anyone without being authenticated.

It worked as expected.

Now, I was ready to deploy it in firebase, so I did a production build first then type the command in the command prompt

firebase deploy

Suddenly, my app stopped working! I can’t access the “users” node anymore. It was too late before I realized that I forgot to update the database.rules.json file in my project!

The silver lining for this mistake is that my security rules is simple enough and I can recreate it immediately. But imagine what would happen if it is a complex security rules and thousands of users are already using it?! ( Well okay around 25-50 users ) That would be a disaster.

Always think twice before pressing that ‘enter’ key when deploying and you will thank me later.

Leave a Reply

Your email address will not be published. Required fields are marked *