{"action":"created","comment":{"url":"https://api.github.com/repos/OpenTreeMap/otm-core/pulls/comments/60943145","id":60943145,"diff_hunk":"@@ -130,15 +130,15 @@ var urlStateTests = {\n         var context = createContext();\n         urlState.init(context);\n         urlState.stateChangeStream.take(1).onValue(function(state) {\n-            assert.deepEqual(state, {bar: 2});\n+            assert.deepEqual(state, {bar: '2'});","path":"opentreemap/treemap/js/test/urlState.js","position":5,"original_position":5,"commit_id":"78a1213308cd534f5f2daa82b2263ced58b5e93c","original_commit_id":"78a1213308cd534f5f2daa82b2263ced58b5e93c","user":{"login":"maurizi","id":4432106,"avatar_url":"https://avatars.githubusercontent.com/u/4432106?v=3","gravatar_id":"","url":"https://api.github.com/users/maurizi","html_url":"https://github.com/maurizi","followers_url":"https://api.github.com/users/maurizi/followers","following_url":"https://api.github.com/users/maurizi/following{/other_user}","gists_url":"https://api.github.com/users/maurizi/gists{/gist_id}","starred_url":"https://api.github.com/users/maurizi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maurizi/subscriptions","organizations_url":"https://api.github.com/users/maurizi/orgs","repos_url":"https://api.github.com/users/maurizi/repos","events_url":"https://api.github.com/users/maurizi/events{/privacy}","received_events_url":"https://api.github.com/users/maurizi/received_events","type":"User","site_admin":false},"body":"Adding in the line `newState = getStateFromUrl(getUrlFromState(newState));` means that we always serialize our URL state to text and then deserialize it back to a JS object.  For special-cased items that have a deserialize function builtin, like `zoomLatLng` we can convert it to a number, but for unrecognized items in the URL they'll always be text.\r\n\r\nThis was the case before when we loaded the page with those items in the URL, so this isn't changing behaviour too drastically.","created_at":"2016-04-25T16:25:05Z","updated_at":"2016-04-25T16:25:05Z","html_url":"https://github.com/OpenTreeMap/otm-core/pull/2560#discussion_r60943145","pull_request_url":"https://api.github.com/repos/OpenTreeMap/otm-core/pulls/2560","_links":{"self":{"href":"https://api.github.com/repos/OpenTreeMap/otm-core/pulls/comments/60943145"},"html":{"href":"https://github.com/OpenTreeMap/otm-core/pull/2560#discussion_r60943145"},"pull_request":{"href":"https://api.github.com/repos/OpenTreeMap/otm-core/pulls/2560"}}},"pull_request":{"url":"https://api.github.com/repos/OpenTreeMap/otm-core/pulls/2560","id":67520285,"html_url":"https://github.com/OpenTreeMap/otm-core/pull/2560","diff_url":"https://github.com/OpenTreeMap/otm-core/pull/2560.diff","patch_url":"https://github.com/OpenTreeMap/otm-core/pull/2560.patch","issue_url":"https://api.github.com/repos/OpenTreeMap/otm-core/issues/2560","number":2560,"state":"open","locked":false,"title":"Fix infinite loop of browser map state","user":{"login":"maurizi","id":4432106,"avatar_url":"https://avatars.githubusercontent.com/u/4432106?v=3","gravatar_id":"","url":"https://api.github.com/users/maurizi","html_url":"https://github.com/maurizi","followers_url":"https://api.github.com/users/maurizi/followers","following_url":"https://api.github.com/users/maurizi/following{/other_user}","gists_url":"https://api.github.com/users/maurizi/gists{/gist_id}","starred_url":"https://api.github.com/users/maurizi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maurizi/subscriptions","organizations_url":"https://api.github.com/users/maurizi/orgs","repos_url":"https://api.github.com/users/maurizi/repos","events_url":"https://api.github.com/users/maurizi/events{/privacy}","received_events_url":"https://api.github.com/users/maurizi/received_events","type":"User","site_admin":false},"body":"When panning or zooming the map, we store the map state in the URL.\r\nConversely, when changing the URL, we pan or zoom the map to match the new URL.\r\n\r\nBecause we used a fixed precision when storing lat/lng in the URL, but did not\r\ndo so for the state object that stored the current zoom/lat/lng, it was\r\npossible for changes to the map state to cause an infinite loop, where the URL\r\nand map state would constantly change but never get in sync with each other.\r\n\r\nBy serializing and deserializing our internal state object whenever we change\r\nthe URL, we ensure that when we later compare the current state object to the\r\nnew state to try and detect changes we'll never encounter these loops.\r\n\r\nConnects to #2558","created_at":"2016-04-22T14:28:48Z","updated_at":"2016-04-25T16:25:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"742329c3113d12834696b1277554364c5a5da870","assignee":{"login":"jwalgran","id":17363,"avatar_url":"https://avatars.githubusercontent.com/u/17363?v=3","gravatar_id":"","url":"https://api.github.com/users/jwalgran","html_url":"https://github.com/jwalgran","followers_url":"https://api.github.com/users/jwalgran/followers","following_url":"https://api.github.com/users/jwalgran/following{/other_user}","gists_url":"https://api.github.com/users/jwalgran/gists{/gist_id}","starred_url":"https://api.github.com/users/jwalgran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwalgran/subscriptions","organizations_url":"https://api.github.com/users/jwalgran/orgs","repos_url":"https://api.github.com/users/jwalgran/repos","events_url":"https://api.github.com/users/jwalgran/events{/privacy}","received_events_url":"https://api.github.com/users/jwalgran/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/OpenTreeMap/otm-core/pulls/2560/commits","review_comments_url":"https://api.github.com/repos/OpenTreeMap/otm-core/pulls/2560/comments","review_comment_url":"https://api.github.com/repos/OpenTreeMap/otm-core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OpenTreeMap/otm-core/issues/2560/comments","statuses_url":"https://api.github.com/repos/OpenTreeMap/otm-core/statuses/78a1213308cd534f5f2daa82b2263ced58b5e93c","head":{"label":"maurizi:fix-url-state-infinite-event-loop","ref":"fix-url-state-infinite-event-loop","sha":"78a1213308cd534f5f2daa82b2263ced58b5e93c","user":{"login":"maurizi","id":4432106,"avatar_url":"https://avatars.githubusercontent.com/u/4432106?v=3","gravatar_id":"","url":"https://api.github.com/users/maurizi","html_url":"https://github.com/maurizi","followers_url":"https://api.github.com/users/maurizi/followers","following_url":"https://api.github.com/users/maurizi/following{/other_user}","gists_url":"https://api.github.com/users/maurizi/gists{/gist_id}","starred_url":"https://api.github.com/users/maurizi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maurizi/subscriptions","organizations_url":"https://api.github.com/users/maurizi/orgs","repos_url":"https://api.github.com/users/maurizi/repos","events_url":"https://api.github.com/users/maurizi/events{/privacy}","received_events_url":"https://api.github.com/users/maurizi/received_events","type":"User","site_admin":false},"repo":{"id":11374160,"name":"otm-core","full_name":"maurizi/otm-core","owner":{"login":"maurizi","id":4432106,"avatar_url":"https://avatars.githubusercontent.com/u/4432106?v=3","gravatar_id":"","url":"https://api.github.com/users/maurizi","html_url":"https://github.com/maurizi","followers_url":"https://api.github.com/users/maurizi/followers","following_url":"https://api.github.com/users/maurizi/following{/other_user}","gists_url":"https://api.github.com/users/maurizi/gists{/gist_id}","starred_url":"https://api.github.com/users/maurizi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maurizi/subscriptions","organizations_url":"https://api.github.com/users/maurizi/orgs","repos_url":"https://api.github.com/users/maurizi/repos","events_url":"https://api.github.com/users/maurizi/events{/privacy}","received_events_url":"https://api.github.com/users/maurizi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/maurizi/otm-core","description":"","fork":true,"url":"https://api.github.com/repos/maurizi/otm-core","forks_url":"https://api.github.com/repos/maurizi/otm-core/forks","keys_url":"https://api.github.com/repos/maurizi/otm-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/maurizi/otm-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/maurizi/otm-core/teams","hooks_url":"https://api.github.com/repos/maurizi/otm-core/hooks","issue_events_url":"https://api.github.com/repos/maurizi/otm-core/issues/events{/number}","events_url":"https://api.github.com/repos/maurizi/otm-core/events","assignees_url":"https://api.github.com/repos/maurizi/otm-core/assignees{/user}","branches_url":"https://api.github.com/repos/maurizi/otm-core/branches{/branch}","tags_url":"https://api.github.com/repos/maurizi/otm-core/tags","blobs_url":"https://api.github.com/repos/maurizi/otm-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/maurizi/otm-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/maurizi/otm-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/maurizi/otm-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/maurizi/otm-core/statuses/{sha}","languages_url":"https://api.github.com/repos/maurizi/otm-core/languages","stargazers_url":"https://api.github.com/repos/maurizi/otm-core/stargazers","contributors_url":"https://api.github.com/repos/maurizi/otm-core/contributors","subscribers_url":"https://api.github.com/repos/maurizi/otm-core/subscribers","subscription_url":"https://api.github.com/repos/maurizi/otm-core/subscription","commits_url":"https://api.github.com/repos/maurizi/otm-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/maurizi/otm-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/maurizi/otm-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/maurizi/otm-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/maurizi/otm-core/contents/{+path}","compare_url":"https://api.github.com/repos/maurizi/otm-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/maurizi/otm-core/merges","archive_url":"https://api.github.com/repos/maurizi/otm-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/maurizi/otm-core/downloads","issues_url":"https://api.github.com/repos/maurizi/otm-core/issues{/number}","pulls_url":"https://api.github.com/repos/maurizi/otm-core/pulls{/number}","milestones_url":"https://api.github.com/repos/maurizi/otm-core/milestones{/number}","notifications_url":"https://api.github.com/repos/maurizi/otm-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/maurizi/otm-core/labels{/name}","releases_url":"https://api.github.com/repos/maurizi/otm-core/releases{/id}","deployments_url":"https://api.github.com/repos/maurizi/otm-core/deployments","created_at":"2013-07-12T17:26:29Z","updated_at":"2015-06-15T19:13:56Z","pushed_at":"2016-04-22T14:55:54Z","git_url":"git://github.com/maurizi/otm-core.git","ssh_url":"git@github.com:maurizi/otm-core.git","clone_url":"https://github.com/maurizi/otm-core.git","svn_url":"https://github.com/maurizi/otm-core","homepage":null,"size":13245,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"develop"}},"base":{"label":"OpenTreeMap:develop","ref":"develop","sha":"75a75313e17116f47401b66eb3f4285a56b428bb","user":{"login":"OpenTreeMap","id":1125635,"avatar_url":"https://avatars.githubusercontent.com/u/1125635?v=3","gravatar_id":"","url":"https://api.github.com/users/OpenTreeMap","html_url":"https://github.com/OpenTreeMap","followers_url":"https://api.github.com/users/OpenTreeMap/followers","following_url":"https://api.github.com/users/OpenTreeMap/following{/other_user}","gists_url":"https://api.github.com/users/OpenTreeMap/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenTreeMap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenTreeMap/subscriptions","organizations_url":"https://api.github.com/users/OpenTreeMap/orgs","repos_url":"https://api.github.com/users/OpenTreeMap/repos","events_url":"https://api.github.com/users/OpenTreeMap/events{/privacy}","received_events_url":"https://api.github.com/users/OpenTreeMap/received_events","type":"Organization","site_admin":false},"repo":{"id":8292625,"name":"otm-core","full_name":"OpenTreeMap/otm-core","owner":{"login":"OpenTreeMap","id":1125635,"avatar_url":"https://avatars.githubusercontent.com/u/1125635?v=3","gravatar_id":"","url":"https://api.github.com/users/OpenTreeMap","html_url":"https://github.com/OpenTreeMap","followers_url":"https://api.github.com/users/OpenTreeMap/followers","following_url":"https://api.github.com/users/OpenTreeMap/following{/other_user}","gists_url":"https://api.github.com/users/OpenTreeMap/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenTreeMap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenTreeMap/subscriptions","organizations_url":"https://api.github.com/users/OpenTreeMap/orgs","repos_url":"https://api.github.com/users/OpenTreeMap/repos","events_url":"https://api.github.com/users/OpenTreeMap/events{/privacy}","received_events_url":"https://api.github.com/users/OpenTreeMap/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/OpenTreeMap/otm-core","description":"OpenTreeMap is a collaborative platform for crowdsourced tree inventory, ecosystem services calculations, urban forestry analysis, and community engagement.","fork":false,"url":"https://api.github.com/repos/OpenTreeMap/otm-core","forks_url":"https://api.github.com/repos/OpenTreeMap/otm-core/forks","keys_url":"https://api.github.com/repos/OpenTreeMap/otm-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OpenTreeMap/otm-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OpenTreeMap/otm-core/teams","hooks_url":"https://api.github.com/repos/OpenTreeMap/otm-core/hooks","issue_events_url":"https://api.github.com/repos/OpenTreeMap/otm-core/issues/events{/number}","events_url":"https://api.github.com/repos/OpenTreeMap/otm-core/events","assignees_url":"https://api.github.com/repos/OpenTreeMap/otm-core/assignees{/user}","branches_url":"https://api.github.com/repos/OpenTreeMap/otm-core/branches{/branch}","tags_url":"https://api.github.com/repos/OpenTreeMap/otm-core/tags","blobs_url":"https://api.github.com/repos/OpenTreeMap/otm-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OpenTreeMap/otm-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OpenTreeMap/otm-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/OpenTreeMap/otm-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OpenTreeMap/otm-core/statuses/{sha}","languages_url":"https://api.github.com/repos/OpenTreeMap/otm-core/languages","stargazers_url":"https://api.github.com/repos/OpenTreeMap/otm-core/stargazers","contributors_url":"https://api.github.com/repos/OpenTreeMap/otm-core/contributors","subscribers_url":"https://api.github.com/repos/OpenTreeMap/otm-core/subscribers","subscription_url":"https://api.github.com/repos/OpenTreeMap/otm-core/subscription","commits_url":"https://api.github.com/repos/OpenTreeMap/otm-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/OpenTreeMap/otm-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/OpenTreeMap/otm-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/OpenTreeMap/otm-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/OpenTreeMap/otm-core/contents/{+path}","compare_url":"https://api.github.com/repos/OpenTreeMap/otm-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OpenTreeMap/otm-core/merges","archive_url":"https://api.github.com/repos/OpenTreeMap/otm-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OpenTreeMap/otm-core/downloads","issues_url":"https://api.github.com/repos/OpenTreeMap/otm-core/issues{/number}","pulls_url":"https://api.github.com/repos/OpenTreeMap/otm-core/pulls{/number}","milestones_url":"https://api.github.com/repos/OpenTreeMap/otm-core/milestones{/number}","notifications_url":"https://api.github.com/repos/OpenTreeMap/otm-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OpenTreeMap/otm-core/labels{/name}","releases_url":"https://api.github.com/repos/OpenTreeMap/otm-core/releases{/id}","deployments_url":"https://api.github.com/repos/OpenTreeMap/otm-core/deployments","created_at":"2013-02-19T15:11:04Z","updated_at":"2016-04-08T09:10:19Z","pushed_at":"2016-04-22T14:55:54Z","git_url":"git://github.com/OpenTreeMap/otm-core.git","ssh_url":"git@github.com:OpenTreeMap/otm-core.git","clone_url":"https://github.com/OpenTreeMap/otm-core.git","svn_url":"https://github.com/OpenTreeMap/otm-core","homepage":"www.opentreemap.org","size":13584,"stargazers_count":74,"watchers_count":74,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":47,"mirror_url":null,"open_issues_count":318,"forks":47,"open_issues":318,"watchers":74,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/OpenTreeMap/otm-core/pulls/2560"},"html":{"href":"https://github.com/OpenTreeMap/otm-core/pull/2560"},"issue":{"href":"https://api.github.com/repos/OpenTreeMap/otm-core/issues/2560"},"comments":{"href":"https://api.github.com/repos/OpenTreeMap/otm-core/issues/2560/comments"},"review_comments":{"href":"https://api.github.com/repos/OpenTreeMap/otm-core/pulls/2560/comments"},"review_comment":{"href":"https://api.github.com/repos/OpenTreeMap/otm-core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OpenTreeMap/otm-core/pulls/2560/commits"},"statuses":{"href":"https://api.github.com/repos/OpenTreeMap/otm-core/statuses/78a1213308cd534f5f2daa82b2263ced58b5e93c"}}}}