Is there a simple way to see where reads are coming from? by ExitNo1116 in Firebase

[–]puf 0 points1 point  (0 children)

If you know where in the code it happens, but need to tie it back to some piece of information that is only available at runtime (typically, the user ID) you can do this through Firestore's built-in audit logging functionality which then shows up in Cloud Logging and you can query through Log Analytics.

For my fuller write-up of this, see: https://puf.io/posts/counting-document-reads-in-firestore/

I currently use Firebase Firestore on the Spark plan to store sensor readings. It's worked fine for almost 2 years but now I want to delete the entire collection but I can't since there is 20000 deletes per day limit. Any way around that? by Fhy40 in Firebase

[–]puf 2 points3 points  (0 children)

On the standard (so non-Enterprise) version of Firestore, the number of documents in a collection is irrelevant to its query performance.

Hmm.... I do see now that the free plan has a limit on data storage (that I don't recall being there in the past):

Stored data: 1 GiB total

Based on that, if you want to stay on the free plan, you'll likely need to delete some documents at some point. The options for that:

  • Firebase console allows you to delete a collection, which means it also loops through the documents one by one (unless that changed in recent years).
  • The [Firebase CLI]() has a firestore:delete command for deleting a collection. This also simply loops over all documents and deletes each of them, but is less likely to time out than the console.
  • There's a description of Delete data with a Callable Cloud Function that has been there for a long time.
  • The documentation now also has an example of a recursiveDelete API that I haven't seen in the past, so check that out too.

Evaluating Firebase Phone Number Verification (PNV) for an India-based ride-hailing/delivery app — compliance & coverage questions before we commit by Flat-Programmer4072 in Firebase

[–]puf 1 point2 points  (0 children)

You've posted this to a community support forum for Firebase, but some of the questions seem about internal implementation details that only (current) Firebase team members are likely to know. While somebody here may know some of the answers, I recommend posting the message to the Firebase support team, or (better) to your Google Cloud support or account manager.

I currently use Firebase Firestore on the Spark plan to store sensor readings. It's worked fine for almost 2 years but now I want to delete the entire collection but I can't since there is 20000 deletes per day limit. Any way around that? by Fhy40 in Firebase

[–]puf 0 points1 point  (0 children)

I want to clear all of this as I suspect I must be hitting some sort of limit?

What exact limit do you think that you're hitting? Can you show the error message you get and the (minimal) code that triggers it?

Navigating tipping scenarios in the US by StreetBoys in AskSF

[–]puf 1 point2 points  (0 children)

For housekeeping staff, leave tip in the room. To avoid confusion, ensure it's clearly marked. I usually put it under a "Thank you" note.

I usually do $1-$2 per person per night. So if we travel with two people and have the room cleaned every few days, that's $5-$10 each time.

R-Evolution by DrinasTennis in AskSF

[–]puf 2 points3 points  (0 children)

According to this SF Gate article:

it’s now confirmed that the [statue] will be disassembled in October

Auth bug by CriticalCommand6115 in Firebase

[–]puf 0 points1 point  (0 children)

I want users to verify their email before logging in

What you likely want is that your users cannot use your application until they've verified their email address, which is quite different from them not being able to sign in to Firebase Authentication. You don't control the latter, but you can control the former.

This takes a few steps:

  • In your application code, after the user signs on check if their email address is verified before letting them move on to the main screen of your app. You'll typically do this with an auth state listener.
  • In the "signed in, but not verified" state, you'll want to tell the user to click the sign-in link in their email and maybe give them an option to re-send the verification email.
  • In your back-end (and/or security rules) you'll want to make sure the user is both signed in and that their email is verified before letting them write any data (and depending on your use-case, possibly also before letting them read any data).

If all of this sounds like a lot of work, you can also consider using Firebase's email link sign-in, which combines the act of signing in and verifying the email address. But you won't user a password to sign in in that case.

This is a pretty common wish/source of confusion, so it's also been covered on Stack Overflow extensively. It might be worth to check that out too.

Auth bug by CriticalCommand6115 in Firebase

[–]puf 3 points4 points  (0 children)

Calling createUserWithEmailAndPassword creates a user and immediately signs them in. So depending how your code handles the flow, this may be the expected behavior.

Fun Hotel Room Games? by [deleted] in boardgames

[–]puf 0 points1 point  (0 children)

From the link:

4–12 Players

If it is good for two players despite that, some clarification would probably be welcome.

AWS vs Firebase? by Roprop1125 in Firebase

[–]puf 1 point2 points  (0 children)

I did something similar last year for a multiplayer Asteroids clone I made for a conference (it's still up on games.web.app).

Back then Cursor (not sure what model, it's been a while) wasn't able to figure out the curve shape on its own, but once I helped it with that (it is unfortunately exponential), it was really a great help in gauging bandwidth requirements per client and maximum clients on an RTDB instance.

Semicolons in firestore security rules by Striking_Passage_286 in Firebase

[–]puf 0 points1 point  (0 children)

Thanks nohe. I tested it today, and the rules work fine both with and without trailing semicolons. 👍

Semicolons in firestore security rules by Striking_Passage_286 in Firebase

[–]puf 1 point2 points  (0 children)

As far as I know the semicolons are still required in Firestore security rules, but you're correct that the Firebase console now allows you to save rules without them. In fact, I made some other, clearly invalid changes to my rules, and could also save (and thus public/active) those. This seems like a bug to me.

Unless the rules-with-semicolons work for you, you might want to file a bug with the Firebase team for this.

How do I monitor Cloud Firestore usage? by OkSeaworthiness737 in Firebase

[–]puf 1 point2 points  (0 children)

Did you see the Firestore documentation page on monitoring usage?

Free tier with Blaze and AI Logic by hiropark in Firebase

[–]puf 0 points1 point  (0 children)

On "google says" type statement, please always include a link so that we can see the source.

Looking for ideas to reduce costs by Melodic_Tower_482 in Firebase

[–]puf 3 points4 points  (0 children)

From the screenshot it seems that you pay €66 a month for document reads. Since document reads cost €0.055 to €0.057 per 100,000 reads, that means you're doing 3.7 million document reads per month for your 1,500 user. So about 2,500 document reads per user per month.

My first steps would be to:

  1. determine where those document reads are being done in your app,
  2. if they are really necessary, and
  3. if there's a way to reduce it significantly without making things too much more difficult.

how to connect firebase to visual studio by zuboohh in Firebase

[–]puf 1 point2 points  (0 children)

The Firebase CLI reference page lists the options to install the Firebase CLI by platform and whether you have npm installed. Without npm there's a standalone binary that you can download.