polymerfire icon indicating copy to clipboard operation
polymerfire copied to clipboard

firebase-query duplicating values

Open kr05 opened this issue 8 years ago • 8 comments
trafficstars

Description

firbase-query is duplicating my database entries. My database has the following array:

patients: [ uid-1: object, uid-2: object ]

I am then binding the data property to a dom-repeat element, and the output is;

[uid-1, uid-2, uid-2, uid-1]

Expected outcome

dom-repeat displays [uid-1, uid-2]

Actual outcome

dom-repeat displays [uid-1, uid-2, uid-2, uid-1]

Live Demo

The relevant code is in this codeshare. The log statements for the firebase-query element is as follows:

image

Any help would be appreciated. I've been using polymerfire for a while now and this is the first time this happens.

Browsers Affected

  • [x] Chrome

kr05 avatar Jun 29 '17 20:06 kr05

Do you have a working repo we can fork and play with so we can see the issue?

tjmonsi avatar Jul 12 '17 00:07 tjmonsi

I've been having similar issues, it's difficult to reproduce (it often happens when I reset, the page but not always). I'm guessing there is some race condition happening within the firebase-query element. Beyond me, I'll post a sample when I have the time.

tbeattysk avatar Sep 04 '17 10:09 tbeattysk

This issue seem to be same with #170 and #263 I also have this issue, BTW I think firebase-query call multiple times which add more than one "child_added"

jukbot avatar Sep 10 '17 06:09 jukbot

I have investigated it and have put it here: https://github.com/firebase/polymerfire/issues/263#issuecomment-328349397

Will try to issue a PR tomorrow for a quick fix and a long term fix that is performant. Will need to sleep on it though

tjmonsi avatar Sep 10 '17 15:09 tjmonsi

I have the same issue in my app. Any progress on this?

merlinnot avatar Sep 15 '17 11:09 merlinnot

@merlinnot I'm just busy the last week. I will do it this Sunday. :)

tjmonsi avatar Sep 15 '17 13:09 tjmonsi

I have the same problem, is it solved?

jdromero avatar Oct 02 '17 07:10 jdromero

@jdromero https://github.com/firebase/polymerfire/pull/270

merlinnot avatar Oct 02 '17 09:10 merlinnot