IssueRaiser

Rules using resource.data run twice in Firestore emulator

<!-- DO NOT DELETE validate_template=true template_path=.github/ISSUE_TEMPLATE/bug_report.md --> Rules that use `resource.data` appear to be evaluated twice in the Firestore emulator. The first time always fails with an error, but the second one succeeds and allows/denies access as expected. This feels similar to #4325, but doesn't involve the use of `onSnapshot` (although I observed the same issue when using `onSnapshot` instead of `getDoc`). Everything appears correct from the client side - the code doesn't appear to run twice, nor are any errors returned from the request. My rules using `resource.data` appear to work correctly when deployed to Firebase and don't show any errors in the Firebase console. <!-- Thank you for contributing to the Firebase community! Think you found a bug? ======================= Yeah, we're definitely not perfect! Please use this template and include a minimal repro when opening the issue. If you know how to solve the issue, please create a Pull Request, and we'd be happy to review it! Have a feature request? ======================== Great, we love hearing how we can improve our products! However, do not use this template to submit a feature request. Please submit your feature requests to: https://firebase.google.com/support/contact/bugs-features/ Have a usage question? ======================= We get lots of those and we love helping you, but GitHub is not the best place for them and they will be closed. Please take a look at the guide fir

Posted by acmertz on Aug 13, 2023, 7:21 PM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.2,000 issues0 comments

support (Software)

Rules using resource.data run twice in Firestore emulator

acmertzAug 13, 2023, 7:21 PM

<!-- DO NOT DELETE validate_template=true template_path=.github/ISSUE_TEMPLATE/bug_report.md --> Rules that use `resource.data` appear to be evaluated twice in the Firestore emulator. The first time always fails with an error, but the second one succeeds and allows/denies access as expected. This feels similar to #4325, but doesn't involve the use of `onSnapshot` (although I observed the same issue when using `onSnapshot` instead of `getDoc`). Everything appears correct from the client side - the code doesn't appear to run twice, nor are any errors returned from the request. My rules using `resource.data` appear to work correctly when deployed to Firebase and don't show any errors in the Firebase console. <!-- Thank you for contributing to the Firebase community! Think you found a bug? ======================= Yeah, we're definitely not perfect! Please use this template and include a minimal repro when opening the issue. If you know how to solve the issue, please create a Pull Request, and we'd be happy to review it! Have a feature request? ======================== Great, we love hearing how we can improve our products! However, do not use this template to submit a feature request. Please submit your feature requests to: https://firebase.google.com/support/contact/bugs-features/ Have a usage question? ======================= We get lots of those and we love helping you, but GitHub is not the best place for them and they will be closed. Please take a look at the guide fir

Comments (0)

No comments yet. Start the discussion.

Comment on this issue