listen() called twice for same path/queryId

605 views
Skip to first unread message

Sunil Goyal

unread,
Jun 27, 2015, 12:04:39 PM6/27/15
to fireba...@googlegroups.com
Hello,

We are using web sdk of firebase and facing an error  - "listen() called twice for same path/querId"

We are attaching a listener for child_added event on a node reference for chat messages of user with id "1"

reference - "user/messages/1"

After some time we detaching the listener by calling ".off()" on reference ("user/messages/1") to the same node.

After a while, we are trying to attach listener for child_added event on a node reference for chat messages of user with id "2"

reference - "user/messages/2"

In this case - we get the following error:


Can you help us understand what is the issue and how to resolve it?

thanks
Sunil


Jacob Wenger

unread,
Jun 28, 2015, 3:49:15 PM6/28/15
to fireba...@googlegroups.com
Hey Sunil,

Thanks a lot for the bug report. You definitely shouldn't be seeing an internal assert like that. I've forwarded this on to our API team and they will take a look at the issue. Do you by chance have a reliable repro that you can send which would help us debug this issue? If not, we will try to repro it ourselves with your instructions.

Jacob

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/6bc5bcac-b6b8-4fce-a485-8b3726e9939e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Michael Lehenbauer

unread,
Jun 28, 2015, 4:46:55 PM6/28/15
to fireba...@googlegroups.com
Hey Sunil,

As Jacob mentioned, a reliable repro would really help.  What you described definitely works fine under normal circumstances.  If I had to guess, maybe there's an exception occurring somewhere that's leaving us in a bad state.  But without more info, it's hard to know.  Let us know if you have a way to reproduce it or if you notice any exceptions or other clues.

Thanks,
-Michael

Gabe Ragland

unread,
Aug 26, 2015, 4:52:46 PM8/26/15
to Firebase Google Group
I'm seeing this same issue using reactFire, but it only happens when using orderByChild(). If I remove orderByChild('order') from the below firebase query it works fine.

var refSubOutcomes = this.firebase.child('relations/playlist_to_suboutcome/playlist_' + this.props.playlist_id).orderByChild('order');
this.bindAsArray(refSubOutcomes, 'data');

Michael Lehenbauer

unread,
Aug 31, 2015, 11:56:42 AM8/31/15
to Firebase Google Group
Hey Gabe,

Thanks for the info.  We were able to reproduce this and have a fix that should be going out in the next release of the client.  

Sorry for the trouble!
-Michael

Jacob Klapper

unread,
Oct 2, 2015, 3:28:17 AM10/2/15
to Firebase Google Group
Will this issue be fixed anytime soon? I am still experiencing this error when using orderByChild and it is very annoying.

Michael Lehenbauer

unread,
Oct 2, 2015, 12:42:17 PM10/2/15
to Firebase Google Group
I replied to the other thread already, but yes, this should be fixed in the latest Firebase JS client (2.3.1).  Can you give it a try and be sure to let us know if you're still seeing issues?

Thanks!
-Michael

Frank van Puffelen

unread,
Oct 2, 2015, 6:51:02 PM10/2/15
to Firebase Google Group

Jacob Klapper

unread,
Oct 6, 2015, 4:21:16 AM10/6/15
to Firebase Google Group
I am using the iOS SDK and this doesn't seem to be fixed yet. Here is my code: https://gist.github.com/mbcoder17/9ff4b19205ec39b76c50

Jonny Dimond

unread,
Oct 7, 2015, 1:56:03 PM10/7/15
to Firebase Google Group
Hi Jacob,

I just tried to reproduce with your sample code, however it worked fine for me. Can you clarify on which version you are? If you are on the latest (2.4.1 or 2.4.1.1), can you make a minimal example that shows this behavior (the sample code you posted is missing a lot of context and is not self-sufficient, so I needed to make some assumptions and add code) so we can investigate? Thanks

Jonny

zhi yang

unread,
Jun 12, 2016, 11:33:40 AM6/12/16
to Firebase Google Group
i had same issue using vuefire.

.off() must call twice, because ref.limitToLast(25) will call bindAsArray twice.

workaround1:
remove .limitToLast(25) after ref

workaround2:
call twice .off()

firebase 2.x may fix this issue.
Reply all
Reply to author
Forward
0 new messages