{"action":"closed","number":167,"pull_request":{"url":"https://api.github.com/repos/firebase/polymerfire/pulls/167","id":99094087,"html_url":"https://github.com/firebase/polymerfire/pull/167","diff_url":"https://github.com/firebase/polymerfire/pull/167.diff","patch_url":"https://github.com/firebase/polymerfire/pull/167.patch","issue_url":"https://api.github.com/repos/firebase/polymerfire/issues/167","number":167,"state":"closed","locked":false,"title":"Fix change path on firebase-query issue ","user":{"login":"christophe-g","id":1168053,"avatar_url":"https://avatars.githubusercontent.com/u/1168053?v=3","gravatar_id":"","url":"https://api.github.com/users/christophe-g","html_url":"https://github.com/christophe-g","followers_url":"https://api.github.com/users/christophe-g/followers","following_url":"https://api.github.com/users/christophe-g/following{/other_user}","gists_url":"https://api.github.com/users/christophe-g/gists{/gist_id}","starred_url":"https://api.github.com/users/christophe-g/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christophe-g/subscriptions","organizations_url":"https://api.github.com/users/christophe-g/orgs","repos_url":"https://api.github.com/users/christophe-g/repos","events_url":"https://api.github.com/users/christophe-g/events{/privacy}","received_events_url":"https://api.github.com/users/christophe-g/received_events","type":"User","site_admin":false},"body":"Should resolve https://github.com/firebase/polymerfire/issues/100, which is a pretty serious issue.\r\n\r\nBasically, when firebase-query path changes, the data is reset twice (`this.data = this.zeroValue`) -\r\n- The first time here, https://github.com/firebase/polymerfire/blob/master/firebase-query.html#L287\r\n- And the second time there,  https://github.com/firebase/polymerfire/blob/master/firebase-database-behavior.html#L95\r\n\r\nThe problem is that it happens that data is populated (via `__onFirebaseChildAdded`) before the second reset - which then clear the data Array... \r\n\r\nTest case : \r\n```html\r\n<dom-module id=\"test-app\">\r\n  <template>\r\n    <style>\r\n    :host {\r\n      display: block;\r\n    }\r\n    </style>\r\n    <h1>Test App</h1>\r\n    <firebase-app  api-key=\"AIzaSyBzKhxNa2k9pA3m9_Ji3POFAKyGGFnyshI\" auth-domain=\"note-app-firebase-3a483.firebaseapp.com\" database-url=\"https://note-app-firebase-3a483.firebaseio.com\"></firebase-app>\r\n    <firebase-query id=\"query\" log data=\"{{data}}\" path=\"[[path]]\"></firebase-query>\r\n    <firebase-query  log data=\"{{dataStatic}}\" path=\"/list\"></firebase-query>\r\n    <paper-button on-tap=\"togglePath\" raised>toggle path</paper-button>\r\n    <h2>Static path</h2>\r\n    <ul>\r\n      <template is=\"dom-repeat\" items=\"[[dataStatic]]\">\r\n        <li>[[item.val]]</li>\r\n      </template>\r\n    </ul>\r\n    <h2>Dynamic path ([[path]])</h2>\r\n    <p>data is not populated when the path is set back to /list</p>\r\n    <ul>\r\n      <template is=\"dom-repeat\" items=\"[[data]]\">\r\n        <li>[[item.val]]</li>\r\n      </template>\r\n    </ul>\r\n  </template>\r\n  <script>\r\n  Polymer({\r\n    is: 'test-app',\r\n\r\n    properties: {\r\n\r\n      path: {\r\n        type: String,\r\n        value: '/list'\r\n      },\r\n\r\n      dataStatic: Array,\r\n\r\n      data: Array\r\n    },\r\n\r\n    attached:function() {\r\n      firebase.database().ref('/list').set([{val: 'first'},{val: 'second'}], function(e){console.info(e);});\r\n    },\r\n\r\n    togglePath: function() {\r\n      return this.path = this.path === '/list' ? '/emptyList' : '/list';\r\n    }\r\n  });\r\n  </script>\r\n</dom-module>\r\n\r\n```\r\n\r\n","created_at":"2016-12-22T12:07:50Z","updated_at":"2017-02-04T20:22:32Z","closed_at":"2017-02-04T20:22:32Z","merged_at":"2017-02-04T20:22:32Z","merge_commit_sha":"f5be89a067ad9a34867e0381d54ee9412b64729a","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/firebase/polymerfire/pulls/167/commits","review_comments_url":"https://api.github.com/repos/firebase/polymerfire/pulls/167/comments","review_comment_url":"https://api.github.com/repos/firebase/polymerfire/pulls/comments{/number}","comments_url":"https://api.github.com/repos/firebase/polymerfire/issues/167/comments","statuses_url":"https://api.github.com/repos/firebase/polymerfire/statuses/645967e953156603fb83fd0d3c3b387486f5b5d6","head":{"label":"PolymerEl:fix-change-path-issue","ref":"fix-change-path-issue","sha":"645967e953156603fb83fd0d3c3b387486f5b5d6","user":{"login":"PolymerEl","id":17042611,"avatar_url":"https://avatars.githubusercontent.com/u/17042611?v=3","gravatar_id":"","url":"https://api.github.com/users/PolymerEl","html_url":"https://github.com/PolymerEl","followers_url":"https://api.github.com/users/PolymerEl/followers","following_url":"https://api.github.com/users/PolymerEl/following{/other_user}","gists_url":"https://api.github.com/users/PolymerEl/gists{/gist_id}","starred_url":"https://api.github.com/users/PolymerEl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PolymerEl/subscriptions","organizations_url":"https://api.github.com/users/PolymerEl/orgs","repos_url":"https://api.github.com/users/PolymerEl/repos","events_url":"https://api.github.com/users/PolymerEl/events{/privacy}","received_events_url":"https://api.github.com/users/PolymerEl/received_events","type":"Organization","site_admin":false},"repo":{"id":77053728,"name":"polymerfire","full_name":"PolymerEl/polymerfire","owner":{"login":"PolymerEl","id":17042611,"avatar_url":"https://avatars.githubusercontent.com/u/17042611?v=3","gravatar_id":"","url":"https://api.github.com/users/PolymerEl","html_url":"https://github.com/PolymerEl","followers_url":"https://api.github.com/users/PolymerEl/followers","following_url":"https://api.github.com/users/PolymerEl/following{/other_user}","gists_url":"https://api.github.com/users/PolymerEl/gists{/gist_id}","starred_url":"https://api.github.com/users/PolymerEl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PolymerEl/subscriptions","organizations_url":"https://api.github.com/users/PolymerEl/orgs","repos_url":"https://api.github.com/users/PolymerEl/repos","events_url":"https://api.github.com/users/PolymerEl/events{/privacy}","received_events_url":"https://api.github.com/users/PolymerEl/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/PolymerEl/polymerfire","description":"Polymer Web Components for Firebase","fork":true,"url":"https://api.github.com/repos/PolymerEl/polymerfire","forks_url":"https://api.github.com/repos/PolymerEl/polymerfire/forks","keys_url":"https://api.github.com/repos/PolymerEl/polymerfire/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PolymerEl/polymerfire/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PolymerEl/polymerfire/teams","hooks_url":"https://api.github.com/repos/PolymerEl/polymerfire/hooks","issue_events_url":"https://api.github.com/repos/PolymerEl/polymerfire/issues/events{/number}","events_url":"https://api.github.com/repos/PolymerEl/polymerfire/events","assignees_url":"https://api.github.com/repos/PolymerEl/polymerfire/assignees{/user}","branches_url":"https://api.github.com/repos/PolymerEl/polymerfire/branches{/branch}","tags_url":"https://api.github.com/repos/PolymerEl/polymerfire/tags","blobs_url":"https://api.github.com/repos/PolymerEl/polymerfire/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PolymerEl/polymerfire/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PolymerEl/polymerfire/git/refs{/sha}","trees_url":"https://api.github.com/repos/PolymerEl/polymerfire/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PolymerEl/polymerfire/statuses/{sha}","languages_url":"https://api.github.com/repos/PolymerEl/polymerfire/languages","stargazers_url":"https://api.github.com/repos/PolymerEl/polymerfire/stargazers","contributors_url":"https://api.github.com/repos/PolymerEl/polymerfire/contributors","subscribers_url":"https://api.github.com/repos/PolymerEl/polymerfire/subscribers","subscription_url":"https://api.github.com/repos/PolymerEl/polymerfire/subscription","commits_url":"https://api.github.com/repos/PolymerEl/polymerfire/commits{/sha}","git_commits_url":"https://api.github.com/repos/PolymerEl/polymerfire/git/commits{/sha}","comments_url":"https://api.github.com/repos/PolymerEl/polymerfire/comments{/number}","issue_comment_url":"https://api.github.com/repos/PolymerEl/polymerfire/issues/comments{/number}","contents_url":"https://api.github.com/repos/PolymerEl/polymerfire/contents/{+path}","compare_url":"https://api.github.com/repos/PolymerEl/polymerfire/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PolymerEl/polymerfire/merges","archive_url":"https://api.github.com/repos/PolymerEl/polymerfire/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PolymerEl/polymerfire/downloads","issues_url":"https://api.github.com/repos/PolymerEl/polymerfire/issues{/number}","pulls_url":"https://api.github.com/repos/PolymerEl/polymerfire/pulls{/number}","milestones_url":"https://api.github.com/repos/PolymerEl/polymerfire/milestones{/number}","notifications_url":"https://api.github.com/repos/PolymerEl/polymerfire/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PolymerEl/polymerfire/labels{/name}","releases_url":"https://api.github.com/repos/PolymerEl/polymerfire/releases{/id}","deployments_url":"https://api.github.com/repos/PolymerEl/polymerfire/deployments","created_at":"2016-12-21T13:26:55Z","updated_at":"2016-12-21T13:26:58Z","pushed_at":"2017-02-04T10:02:45Z","git_url":"git://github.com/PolymerEl/polymerfire.git","ssh_url":"git@github.com:PolymerEl/polymerfire.git","clone_url":"https://github.com/PolymerEl/polymerfire.git","svn_url":"https://github.com/PolymerEl/polymerfire","homepage":"https://beta.webcomponents.org/element/firebase/polymerfire","size":112,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"firebase:master","ref":"master","sha":"aa93f5f7888a11f58c5dfe9efe9e2434938b9a35","user":{"login":"firebase","id":1335026,"avatar_url":"https://avatars.githubusercontent.com/u/1335026?v=3","gravatar_id":"","url":"https://api.github.com/users/firebase","html_url":"https://github.com/firebase","followers_url":"https://api.github.com/users/firebase/followers","following_url":"https://api.github.com/users/firebase/following{/other_user}","gists_url":"https://api.github.com/users/firebase/gists{/gist_id}","starred_url":"https://api.github.com/users/firebase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/firebase/subscriptions","organizations_url":"https://api.github.com/users/firebase/orgs","repos_url":"https://api.github.com/users/firebase/repos","events_url":"https://api.github.com/users/firebase/events{/privacy}","received_events_url":"https://api.github.com/users/firebase/received_events","type":"Organization","site_admin":false},"repo":{"id":59135852,"name":"polymerfire","full_name":"firebase/polymerfire","owner":{"login":"firebase","id":1335026,"avatar_url":"https://avatars.githubusercontent.com/u/1335026?v=3","gravatar_id":"","url":"https://api.github.com/users/firebase","html_url":"https://github.com/firebase","followers_url":"https://api.github.com/users/firebase/followers","following_url":"https://api.github.com/users/firebase/following{/other_user}","gists_url":"https://api.github.com/users/firebase/gists{/gist_id}","starred_url":"https://api.github.com/users/firebase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/firebase/subscriptions","organizations_url":"https://api.github.com/users/firebase/orgs","repos_url":"https://api.github.com/users/firebase/repos","events_url":"https://api.github.com/users/firebase/events{/privacy}","received_events_url":"https://api.github.com/users/firebase/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/firebase/polymerfire","description":"Polymer Web Components for Firebase","fork":false,"url":"https://api.github.com/repos/firebase/polymerfire","forks_url":"https://api.github.com/repos/firebase/polymerfire/forks","keys_url":"https://api.github.com/repos/firebase/polymerfire/keys{/key_id}","collaborators_url":"https://api.github.com/repos/firebase/polymerfire/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/firebase/polymerfire/teams","hooks_url":"https://api.github.com/repos/firebase/polymerfire/hooks","issue_events_url":"https://api.github.com/repos/firebase/polymerfire/issues/events{/number}","events_url":"https://api.github.com/repos/firebase/polymerfire/events","assignees_url":"https://api.github.com/repos/firebase/polymerfire/assignees{/user}","branches_url":"https://api.github.com/repos/firebase/polymerfire/branches{/branch}","tags_url":"https://api.github.com/repos/firebase/polymerfire/tags","blobs_url":"https://api.github.com/repos/firebase/polymerfire/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/firebase/polymerfire/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/firebase/polymerfire/git/refs{/sha}","trees_url":"https://api.github.com/repos/firebase/polymerfire/git/trees{/sha}","statuses_url":"https://api.github.com/repos/firebase/polymerfire/statuses/{sha}","languages_url":"https://api.github.com/repos/firebase/polymerfire/languages","stargazers_url":"https://api.github.com/repos/firebase/polymerfire/stargazers","contributors_url":"https://api.github.com/repos/firebase/polymerfire/contributors","subscribers_url":"https://api.github.com/repos/firebase/polymerfire/subscribers","subscription_url":"https://api.github.com/repos/firebase/polymerfire/subscription","commits_url":"https://api.github.com/repos/firebase/polymerfire/commits{/sha}","git_commits_url":"https://api.github.com/repos/firebase/polymerfire/git/commits{/sha}","comments_url":"https://api.github.com/repos/firebase/polymerfire/comments{/number}","issue_comment_url":"https://api.github.com/repos/firebase/polymerfire/issues/comments{/number}","contents_url":"https://api.github.com/repos/firebase/polymerfire/contents/{+path}","compare_url":"https://api.github.com/repos/firebase/polymerfire/compare/{base}...{head}","merges_url":"https://api.github.com/repos/firebase/polymerfire/merges","archive_url":"https://api.github.com/repos/firebase/polymerfire/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/firebase/polymerfire/downloads","issues_url":"https://api.github.com/repos/firebase/polymerfire/issues{/number}","pulls_url":"https://api.github.com/repos/firebase/polymerfire/pulls{/number}","milestones_url":"https://api.github.com/repos/firebase/polymerfire/milestones{/number}","notifications_url":"https://api.github.com/repos/firebase/polymerfire/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/firebase/polymerfire/labels{/name}","releases_url":"https://api.github.com/repos/firebase/polymerfire/releases{/id}","deployments_url":"https://api.github.com/repos/firebase/polymerfire/deployments","created_at":"2016-05-18T17:09:40Z","updated_at":"2017-02-03T05:47:43Z","pushed_at":"2017-02-04T20:22:32Z","git_url":"git://github.com/firebase/polymerfire.git","ssh_url":"git@github.com:firebase/polymerfire.git","clone_url":"https://github.com/firebase/polymerfire.git","svn_url":"https://github.com/firebase/polymerfire","homepage":"https://beta.webcomponents.org/element/firebase/polymerfire","size":100,"stargazers_count":295,"watchers_count":295,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":82,"mirror_url":null,"open_issues_count":55,"forks":82,"open_issues":55,"watchers":295,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/firebase/polymerfire/pulls/167"},"html":{"href":"https://github.com/firebase/polymerfire/pull/167"},"issue":{"href":"https://api.github.com/repos/firebase/polymerfire/issues/167"},"comments":{"href":"https://api.github.com/repos/firebase/polymerfire/issues/167/comments"},"review_comments":{"href":"https://api.github.com/repos/firebase/polymerfire/pulls/167/comments"},"review_comment":{"href":"https://api.github.com/repos/firebase/polymerfire/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/firebase/polymerfire/pulls/167/commits"},"statuses":{"href":"https://api.github.com/repos/firebase/polymerfire/statuses/645967e953156603fb83fd0d3c3b387486f5b5d6"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"mbleigh","id":1022,"avatar_url":"https://avatars.githubusercontent.com/u/1022?v=3","gravatar_id":"","url":"https://api.github.com/users/mbleigh","html_url":"https://github.com/mbleigh","followers_url":"https://api.github.com/users/mbleigh/followers","following_url":"https://api.github.com/users/mbleigh/following{/other_user}","gists_url":"https://api.github.com/users/mbleigh/gists{/gist_id}","starred_url":"https://api.github.com/users/mbleigh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbleigh/subscriptions","organizations_url":"https://api.github.com/users/mbleigh/orgs","repos_url":"https://api.github.com/users/mbleigh/repos","events_url":"https://api.github.com/users/mbleigh/events{/privacy}","received_events_url":"https://api.github.com/users/mbleigh/received_events","type":"User","site_admin":false},"comments":1,"review_comments":0,"maintainer_can_modify":false,"commits":2,"additions":15,"deletions":0,"changed_files":1}}
{"actor":{"display_login":"mbleigh"}}