Open eob opened 7 years ago
I think the query is not related to work along side having a user signed in. Thus, it will not re-fire because it doesn't have anything connected from the auth.
But I do believe that data should flow once there is a user authenticated, but I guess I think this is on firebase because if it already returned an error, it will not do the on() value?
The
<firebase-query>
element is not rebinding to the remote DB aftersignInWithCustomToken
is being called in some circumstances for us.Expected outcome
Actual outcome
After logging into firebase, the query does not re-fire and the
data
attribute of the query element is not filled with data.Through manual inspection via the console, we can see that the authentication did happen correctly and the
firebase-query
element is correctly connected to the database. The following code, for example, works just fine:In console:
So we believe this issue has something to do with event handling -- the connection's fine; the query just wasn't re-triggered.
Another twist: we're running a single page app. This problem only occurs the first time a user logs in (simulated in a private browsing window). If the user re-visits the site, thus resuming a session from cookies, the problem does not manifest.
Note that both cases ought to appear identical from the firebase perspective. We have our own separate authentication system, and we're generating web tokens on the fly in both cases. The only difference is the duration of time on the site the user remains unauthenticated.
signInWithCustomToken
.signInWithCustomToken
is calledLive Demo
We've fixed the problem with the following code:
This was on a production site, so we don't have something you can try yourselves at the moment.
Steps to reproduce
Browsers Affected