-
Notifications
You must be signed in to change notification settings - Fork 930
Expo and Firestore security rules #703
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
So just to confirm, this happens with 4.12.1 but not 4.6.2? If you can verify exactly what release the regression occurred in, that will help us track it down. And can you capture logs by calling |
I can confirm that security rules work with 4.6.2 and stop working with 4.7.0
|
Thanks for the details. I've been able to reproduce the issue, though I don't know yet what's causing it. I'll let you know when I know more. |
I found the PR that's seemingly responsible (the problem goes away if I revert it), but I can't figure out why. :-/ #322 The issue happens on both Android and iOS, and very suspiciously goes away if I enable the network inspector in the React Native Debugger. So I think there's probably a bug (or at least behavioral difference) in the React Native networking stack at play, but despite debugging pretty deep I haven't been able to determine what it is. :-/ |
I've opened PR #717 to address this by implementing the workaround of not using $httpHeaders on React Native. For reference, my investigation up to this point:
So I'm just moving forward with the workaround. |
Any news about this work around ? |
@llccrr Sorry, I need to do a bit of cleanup to that PR and haven't gotten a chance. It should move forward in the next day or two. Until it lands and releases, you'll probably want to stick with Firebase 4.6.2. Sorry for the inconvenience. |
Okay, my PR was merged and this should be fixed in the next release. |
EDIT Upgraded to [email protected] and I'm still having the issue.
From the Firestore documentation to allow access to every documents if the user is signed in. |
Thanks for the update. I'm not sure why you had to "yarn remove" / "yarn add" but I'm glad it worked. I'm closing this issue. If anybody is seeing this after [email protected], let us know. Thanks! |
I was on 4.6.2 for a long time and the other day it magically broke on Android and gave me the same permissions errors. I resolved it by bumping to 5.3.1 but I'd like to understand how this happened. Is it possible that something changed in the Firestore back end to make this suddenly break? |
I’m using expo and the firebase web sdk (cause native firebase sdk is not working without detaching expo project).
When I decided to set up firestore security rules like this:
suddenly I got permission-denied. It appears both on Android/iOS

User is 100% authorized and I am not the only one who experiences this problem. I found it at StackOverflow, Firebase Google Group, Firebase Slack channel, Expo forums but it seems that no one creates the issue here.
The only solution was suggested at stackoverflow - downgrading firebase sdk to 4.6.2.
But I really don't like it, it has a problem with firestore on Android and need to be patched.
I understand that using firebase web sdk for Android/iOS is not the case but is there any chance that the issue will be fixed?
The text was updated successfully, but these errors were encountered: