'Firebase -- exceeded quota number of reads

I have created a simple firebase webapp, which is subscribed to listen for changes within a collection in firestore. As there are only 3 items in that collection, I was wondering how it was possible to reach the quota limit of 50k reads a day. I did leave the app running on localhost while I was away from my computer, which I am assuming is the reason that it reached the daily quota limit. But how was it possible to do that?

Basically, I have one page on my webapp that is subscribed to my collection in firestore. I then use that data retrieved to display it on the page.

enter image description here

As I said, there are only 3 items in the collection I am subscribed to. How does the subscription work? Is it constantly reading the database to watch for changes, or does it only do a read request when the collection changes (a doc being added or removed, for example)?

PS I have not even published this app to the web, so I don't think it's even possible for read requests to be coming from another computer.



Solution 1:[1]

You got a loop there useEffect is triggered whenever products changes, and you are calling setProducts in the useEffect itself.

So i'm thinking that this has consumed all your daily quota.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 asi hej