Skip to content
This repository was archived by the owner on May 19, 2025. It is now read-only.
This repository was archived by the owner on May 19, 2025. It is now read-only.

Possible ordering dependency with firebase-query attached handler #53

@43081j

Description

@43081j

For example:

<firebase-query path="/test" data="{{test}}"></firebase-query>

Steps to reproduce

  • Load a page with a firebase-query in a background tab
  • Switch to the tab
  • Notice the query's data is empty

Why?

If you load this in an unfocused (background) tab in your browser, the query will be setup correctly and the data will be populated as expected (child_added events are fired).

If you then focus the tab in your browser, the first requested animation frame is processed, so Polymer calls any attached handlers. This triggers __queryChanged which will set the data to [].

The problem here seems to be that, because we already got the initial child_added events, they will not fire again and we will keep our empty array.

Not sure how we should deal with this, being more careful around the attached event somehow.

Expected behaviour

  • child_added events fire
  • data is populated
  • tab is focused
  • data remains populated

Actual behaviour

  • child_added events fire
  • data is populated
  • tab is focused
  • data is set to []
  • child_added events don't fire again, data remains []

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions