I’m trying to learn Firebase Security Rules for Firestore. Not to mention the extreme lack of clarity in the docs, I’m struggling to make sense of these random UPDATE
requests that have no resource
attached.
From what I’ve read, the resource
object is a reference to what’s in the database already. If it’s an UPDATE
request, it should exist. So, something like,
allow update: if resource.data.id != null;
should work fine and never generate an error.
But it clearly is not working. Follow below:
In my Firebase emulator, under Firestore > Requests, there are several UPDATE
requests failing with an Error:
When I opened one up, to figure out why it’s failing, I noted that the resource object that should contain something is somehow an error:
What in heck is going on here? Where is this request coming from, that it doesn’t have any resource object? Is this behavior even documented?
Thanks