Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firestore Rules coverage report - Request expression never evaluated

Recently I have been using firebase for my new app. Since you can define your own rules on firestore, I wanted to try that out.

To test these rules I am running the firestore emulator. When I try to authorize some test user I always get a timeout error. Wanting to solve the error by myself I've made some research.

I have found out that it is possible to see the "Firestore Rule Coverage Report" and inside there I've seen this:

Error message of Firestore Rule Coverage Report

But since I am new to firestore I did not know what this is and also after some googling I didn't find out how to solve this problem.

like image 546
Snieder Avatar asked May 02 '26 20:05

Snieder


1 Answers

Firestore docs are a bit confusing. They state that the URL should be:

http://localhost:8080/emulator/v1/projects/<database_name>:ruleCoverage.html

However, they don't explain what <database_name> should be replaced with your project_id. Yes... reading the URL some might thing is obvious, but is really the argument name that should make it obvious. Plus, in Firestore databases are not created neither accessed by name.

SOLUTION:

<database_name> should be replaced by your project_id (this value is available in the files .firebaserc or google-services.json

So, if your project_id is my-amazing-app, your rulesCoverage url would be: http://localhost:8080/emulator/v1/projects/my-amazing-app:ruleCoverage.html

like image 132
JesusIniesta Avatar answered May 04 '26 08:05

JesusIniesta



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!