Skip to content
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

firebase-query not setting exists=false on the first run #349

Open
iSuslov opened this issue May 31, 2018 · 6 comments
Open

firebase-query not setting exists=false on the first run #349

iSuslov opened this issue May 31, 2018 · 6 comments

Comments

@iSuslov
Copy link

iSuslov commented May 31, 2018

Description

firebase-query not setting exists=false on the first run

Expected outcome

exists=false on the first run when snapshot.hasChildren() == false

Actual outcome

ignores exists parameter and leaves it as null. Can not track that loading is finished

Steps to reproduce

Create firebase-query for empty collection and check what happens with exists property (Nothing).

@andrewspy
Copy link

@iSuslov I have similar issue with <firebase-document>, would you be able to confirm the issue on <firebase-document> and provide a fix as well?

@iSuslov
Copy link
Author

iSuslov commented Jun 1, 2018

@andrewspy I can confirm by reviewing the code in master branch that firebase-document sets exists on the first run, however keep in mind that it does not do that if any error happens, for example permission denied. You have to listen for error event to have a whole picture.

@andrewspy
Copy link

@iSuslov Thanks for the info, you are right, exists will remain null if there is no security permission given to the path.

May I know how to listen for error event in <firebase-document>? Using <firebase-document on-error="errorHandler"> doesn't seem to work and I can't find it in polymerfire documentation

@iSuslov
Copy link
Author

iSuslov commented Jul 5, 2018

@andrewspy on-error should work, see firebase-common-behavior.html which is a part of firebase-document

@andrewspy
Copy link

@iSuslov I have tried out on-error on another test case, and it works as expected.

The reason on-error doesn't work on my case is that I have an empty path name (i.e. /tenants//users/LSjsiBNv1/data), and running it against the rule simulator resulted "permission denied", but it somehow doesn't emit any error when using it as the path in <firebase-document>. Not exactly sure if it's the expected behaviour.

Anyway, thanks for the help.

@iSuslov
Copy link
Author

iSuslov commented Aug 24, 2018

@andrewspy should be expected behaviour, since it won't make actual request to the server if path is empty or invalid - containing //.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants