{"action":"created","comment":{"url":"https://api.github.com/repos/wikimedia/hyperswitch/pulls/comments/74619940","id":74619940,"diff_hunk":"@@ -421,8 +421,9 @@ Router.prototype._handlePaths = function(rootNode, spec, scope) {\n \n     // Handle paths\n     // Sequence the build process with `.each` to avoid race conditions\n-    // while building the tree.\n-    return P.each(Object.keys(paths), function(pathPattern) {\n+    // while building the tree. Also sort(), so that fixed path segments sort\n+    // before patterns (by virtue of `[a-zA-Z/] < '{'`).\n+    return P.each(Object.keys(paths).sort(), function(pathPattern) {","path":"lib/router.js","position":8,"original_position":8,"commit_id":"bea41d2f0b4ec027a1567a03bab018b82216237d","original_commit_id":"bea41d2f0b4ec027a1567a03bab018b82216237d","user":{"login":"Pchelolo","id":814754,"avatar_url":"https://avatars.githubusercontent.com/u/814754?v=3","gravatar_id":"","url":"https://api.github.com/users/Pchelolo","html_url":"https://github.com/Pchelolo","followers_url":"https://api.github.com/users/Pchelolo/followers","following_url":"https://api.github.com/users/Pchelolo/following{/other_user}","gists_url":"https://api.github.com/users/Pchelolo/gists{/gist_id}","starred_url":"https://api.github.com/users/Pchelolo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Pchelolo/subscriptions","organizations_url":"https://api.github.com/users/Pchelolo/orgs","repos_url":"https://api.github.com/users/Pchelolo/repos","events_url":"https://api.github.com/users/Pchelolo/events{/privacy}","received_events_url":"https://api.github.com/users/Pchelolo/received_events","type":"User","site_admin":false},"body":"@gwicke I think we should go with the 'sort the copy' solution.","created_at":"2016-08-12T16:27:11Z","updated_at":"2016-08-12T16:27:11Z","html_url":"https://github.com/wikimedia/hyperswitch/pull/55#discussion_r74619940","pull_request_url":"https://api.github.com/repos/wikimedia/hyperswitch/pulls/55","_links":{"self":{"href":"https://api.github.com/repos/wikimedia/hyperswitch/pulls/comments/74619940"},"html":{"href":"https://github.com/wikimedia/hyperswitch/pull/55#discussion_r74619940"},"pull_request":{"href":"https://api.github.com/repos/wikimedia/hyperswitch/pulls/55"}}},"pull_request":{"url":"https://api.github.com/repos/wikimedia/hyperswitch/pulls/55","id":80541974,"html_url":"https://github.com/wikimedia/hyperswitch/pull/55","diff_url":"https://github.com/wikimedia/hyperswitch/pull/55.diff","patch_url":"https://github.com/wikimedia/hyperswitch/pull/55.patch","issue_url":"https://api.github.com/repos/wikimedia/hyperswitch/issues/55","number":55,"state":"open","locked":false,"title":"Sort paths before building the tree","user":{"login":"gwicke","id":1225898,"avatar_url":"https://avatars.githubusercontent.com/u/1225898?v=3","gravatar_id":"","url":"https://api.github.com/users/gwicke","html_url":"https://github.com/gwicke","followers_url":"https://api.github.com/users/gwicke/followers","following_url":"https://api.github.com/users/gwicke/following{/other_user}","gists_url":"https://api.github.com/users/gwicke/gists{/gist_id}","starred_url":"https://api.github.com/users/gwicke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gwicke/subscriptions","organizations_url":"https://api.github.com/users/gwicke/orgs","repos_url":"https://api.github.com/users/gwicke/repos","events_url":"https://api.github.com/users/gwicke/events{/privacy}","received_events_url":"https://api.github.com/users/gwicke/received_events","type":"User","site_admin":false},"body":"Deterministically resolve conflicts & add specific keys before wildcards.\r\n\r\nWithout this patch, a path combination like\r\n\r\n  /{something}/else\r\n  /robots.txt\r\n\r\nwas not accepted, as v8 happens to preserve the order of object keys in this\r\ncase, and the wildcard would be added before the fixed value. This would cause\r\nthe router to enter the wildcard path when trying to add robots.txt.\r\n\r\nWith this patch, more specific paths (without wildcards) are built first,\r\nequivalent to:\r\n\r\n  /robots.txt\r\n  /{something}/else","created_at":"2016-08-09T00:01:17Z","updated_at":"2016-08-12T16:27:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9586cf7b2f19959742a05b2e90360030c1d34440","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/wikimedia/hyperswitch/pulls/55/commits","review_comments_url":"https://api.github.com/repos/wikimedia/hyperswitch/pulls/55/comments","review_comment_url":"https://api.github.com/repos/wikimedia/hyperswitch/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wikimedia/hyperswitch/issues/55/comments","statuses_url":"https://api.github.com/repos/wikimedia/hyperswitch/statuses/bea41d2f0b4ec027a1567a03bab018b82216237d","head":{"label":"gwicke:sort_paths","ref":"sort_paths","sha":"bea41d2f0b4ec027a1567a03bab018b82216237d","user":{"login":"gwicke","id":1225898,"avatar_url":"https://avatars.githubusercontent.com/u/1225898?v=3","gravatar_id":"","url":"https://api.github.com/users/gwicke","html_url":"https://github.com/gwicke","followers_url":"https://api.github.com/users/gwicke/followers","following_url":"https://api.github.com/users/gwicke/following{/other_user}","gists_url":"https://api.github.com/users/gwicke/gists{/gist_id}","starred_url":"https://api.github.com/users/gwicke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gwicke/subscriptions","organizations_url":"https://api.github.com/users/gwicke/orgs","repos_url":"https://api.github.com/users/gwicke/repos","events_url":"https://api.github.com/users/gwicke/events{/privacy}","received_events_url":"https://api.github.com/users/gwicke/received_events","type":"User","site_admin":false},"repo":{"id":51480735,"name":"hyperswitch","full_name":"gwicke/hyperswitch","owner":{"login":"gwicke","id":1225898,"avatar_url":"https://avatars.githubusercontent.com/u/1225898?v=3","gravatar_id":"","url":"https://api.github.com/users/gwicke","html_url":"https://github.com/gwicke","followers_url":"https://api.github.com/users/gwicke/followers","following_url":"https://api.github.com/users/gwicke/following{/other_user}","gists_url":"https://api.github.com/users/gwicke/gists{/gist_id}","starred_url":"https://api.github.com/users/gwicke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gwicke/subscriptions","organizations_url":"https://api.github.com/users/gwicke/orgs","repos_url":"https://api.github.com/users/gwicke/repos","events_url":"https://api.github.com/users/gwicke/events{/privacy}","received_events_url":"https://api.github.com/users/gwicke/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gwicke/hyperswitch","description":"","fork":true,"url":"https://api.github.com/repos/gwicke/hyperswitch","forks_url":"https://api.github.com/repos/gwicke/hyperswitch/forks","keys_url":"https://api.github.com/repos/gwicke/hyperswitch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gwicke/hyperswitch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gwicke/hyperswitch/teams","hooks_url":"https://api.github.com/repos/gwicke/hyperswitch/hooks","issue_events_url":"https://api.github.com/repos/gwicke/hyperswitch/issues/events{/number}","events_url":"https://api.github.com/repos/gwicke/hyperswitch/events","assignees_url":"https://api.github.com/repos/gwicke/hyperswitch/assignees{/user}","branches_url":"https://api.github.com/repos/gwicke/hyperswitch/branches{/branch}","tags_url":"https://api.github.com/repos/gwicke/hyperswitch/tags","blobs_url":"https://api.github.com/repos/gwicke/hyperswitch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gwicke/hyperswitch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gwicke/hyperswitch/git/refs{/sha}","trees_url":"https://api.github.com/repos/gwicke/hyperswitch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gwicke/hyperswitch/statuses/{sha}","languages_url":"https://api.github.com/repos/gwicke/hyperswitch/languages","stargazers_url":"https://api.github.com/repos/gwicke/hyperswitch/stargazers","contributors_url":"https://api.github.com/repos/gwicke/hyperswitch/contributors","subscribers_url":"https://api.github.com/repos/gwicke/hyperswitch/subscribers","subscription_url":"https://api.github.com/repos/gwicke/hyperswitch/subscription","commits_url":"https://api.github.com/repos/gwicke/hyperswitch/commits{/sha}","git_commits_url":"https://api.github.com/repos/gwicke/hyperswitch/git/commits{/sha}","comments_url":"https://api.github.com/repos/gwicke/hyperswitch/comments{/number}","issue_comment_url":"https://api.github.com/repos/gwicke/hyperswitch/issues/comments{/number}","contents_url":"https://api.github.com/repos/gwicke/hyperswitch/contents/{+path}","compare_url":"https://api.github.com/repos/gwicke/hyperswitch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gwicke/hyperswitch/merges","archive_url":"https://api.github.com/repos/gwicke/hyperswitch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gwicke/hyperswitch/downloads","issues_url":"https://api.github.com/repos/gwicke/hyperswitch/issues{/number}","pulls_url":"https://api.github.com/repos/gwicke/hyperswitch/pulls{/number}","milestones_url":"https://api.github.com/repos/gwicke/hyperswitch/milestones{/number}","notifications_url":"https://api.github.com/repos/gwicke/hyperswitch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gwicke/hyperswitch/labels{/name}","releases_url":"https://api.github.com/repos/gwicke/hyperswitch/releases{/id}","deployments_url":"https://api.github.com/repos/gwicke/hyperswitch/deployments","created_at":"2016-02-10T23:26:20Z","updated_at":"2016-02-10T23:26:21Z","pushed_at":"2016-08-09T00:02:27Z","git_url":"git://github.com/gwicke/hyperswitch.git","ssh_url":"git@github.com:gwicke/hyperswitch.git","clone_url":"https://github.com/gwicke/hyperswitch.git","svn_url":"https://github.com/gwicke/hyperswitch","homepage":null,"size":2318,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"wikimedia:master","ref":"master","sha":"d6845635acd2fbec22e7143e6c18999974beb4d6","user":{"login":"wikimedia","id":56668,"avatar_url":"https://avatars.githubusercontent.com/u/56668?v=3","gravatar_id":"","url":"https://api.github.com/users/wikimedia","html_url":"https://github.com/wikimedia","followers_url":"https://api.github.com/users/wikimedia/followers","following_url":"https://api.github.com/users/wikimedia/following{/other_user}","gists_url":"https://api.github.com/users/wikimedia/gists{/gist_id}","starred_url":"https://api.github.com/users/wikimedia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wikimedia/subscriptions","organizations_url":"https://api.github.com/users/wikimedia/orgs","repos_url":"https://api.github.com/users/wikimedia/repos","events_url":"https://api.github.com/users/wikimedia/events{/privacy}","received_events_url":"https://api.github.com/users/wikimedia/received_events","type":"Organization","site_admin":false},"repo":{"id":51109567,"name":"hyperswitch","full_name":"wikimedia/hyperswitch","owner":{"login":"wikimedia","id":56668,"avatar_url":"https://avatars.githubusercontent.com/u/56668?v=3","gravatar_id":"","url":"https://api.github.com/users/wikimedia","html_url":"https://github.com/wikimedia","followers_url":"https://api.github.com/users/wikimedia/followers","following_url":"https://api.github.com/users/wikimedia/following{/other_user}","gists_url":"https://api.github.com/users/wikimedia/gists{/gist_id}","starred_url":"https://api.github.com/users/wikimedia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wikimedia/subscriptions","organizations_url":"https://api.github.com/users/wikimedia/orgs","repos_url":"https://api.github.com/users/wikimedia/repos","events_url":"https://api.github.com/users/wikimedia/events{/privacy}","received_events_url":"https://api.github.com/users/wikimedia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wikimedia/hyperswitch","description":"","fork":false,"url":"https://api.github.com/repos/wikimedia/hyperswitch","forks_url":"https://api.github.com/repos/wikimedia/hyperswitch/forks","keys_url":"https://api.github.com/repos/wikimedia/hyperswitch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wikimedia/hyperswitch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wikimedia/hyperswitch/teams","hooks_url":"https://api.github.com/repos/wikimedia/hyperswitch/hooks","issue_events_url":"https://api.github.com/repos/wikimedia/hyperswitch/issues/events{/number}","events_url":"https://api.github.com/repos/wikimedia/hyperswitch/events","assignees_url":"https://api.github.com/repos/wikimedia/hyperswitch/assignees{/user}","branches_url":"https://api.github.com/repos/wikimedia/hyperswitch/branches{/branch}","tags_url":"https://api.github.com/repos/wikimedia/hyperswitch/tags","blobs_url":"https://api.github.com/repos/wikimedia/hyperswitch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wikimedia/hyperswitch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wikimedia/hyperswitch/git/refs{/sha}","trees_url":"https://api.github.com/repos/wikimedia/hyperswitch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wikimedia/hyperswitch/statuses/{sha}","languages_url":"https://api.github.com/repos/wikimedia/hyperswitch/languages","stargazers_url":"https://api.github.com/repos/wikimedia/hyperswitch/stargazers","contributors_url":"https://api.github.com/repos/wikimedia/hyperswitch/contributors","subscribers_url":"https://api.github.com/repos/wikimedia/hyperswitch/subscribers","subscription_url":"https://api.github.com/repos/wikimedia/hyperswitch/subscription","commits_url":"https://api.github.com/repos/wikimedia/hyperswitch/commits{/sha}","git_commits_url":"https://api.github.com/repos/wikimedia/hyperswitch/git/commits{/sha}","comments_url":"https://api.github.com/repos/wikimedia/hyperswitch/comments{/number}","issue_comment_url":"https://api.github.com/repos/wikimedia/hyperswitch/issues/comments{/number}","contents_url":"https://api.github.com/repos/wikimedia/hyperswitch/contents/{+path}","compare_url":"https://api.github.com/repos/wikimedia/hyperswitch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wikimedia/hyperswitch/merges","archive_url":"https://api.github.com/repos/wikimedia/hyperswitch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wikimedia/hyperswitch/downloads","issues_url":"https://api.github.com/repos/wikimedia/hyperswitch/issues{/number}","pulls_url":"https://api.github.com/repos/wikimedia/hyperswitch/pulls{/number}","milestones_url":"https://api.github.com/repos/wikimedia/hyperswitch/milestones{/number}","notifications_url":"https://api.github.com/repos/wikimedia/hyperswitch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wikimedia/hyperswitch/labels{/name}","releases_url":"https://api.github.com/repos/wikimedia/hyperswitch/releases{/id}","deployments_url":"https://api.github.com/repos/wikimedia/hyperswitch/deployments","created_at":"2016-02-04T22:13:40Z","updated_at":"2016-07-05T01:46:31Z","pushed_at":"2016-08-09T00:02:28Z","git_url":"git://github.com/wikimedia/hyperswitch.git","ssh_url":"git@github.com:wikimedia/hyperswitch.git","clone_url":"https://github.com/wikimedia/hyperswitch.git","svn_url":"https://github.com/wikimedia/hyperswitch","homepage":null,"size":2321,"stargazers_count":3,"watchers_count":3,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":2,"forks":5,"open_issues":2,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wikimedia/hyperswitch/pulls/55"},"html":{"href":"https://github.com/wikimedia/hyperswitch/pull/55"},"issue":{"href":"https://api.github.com/repos/wikimedia/hyperswitch/issues/55"},"comments":{"href":"https://api.github.com/repos/wikimedia/hyperswitch/issues/55/comments"},"review_comments":{"href":"https://api.github.com/repos/wikimedia/hyperswitch/pulls/55/comments"},"review_comment":{"href":"https://api.github.com/repos/wikimedia/hyperswitch/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wikimedia/hyperswitch/pulls/55/commits"},"statuses":{"href":"https://api.github.com/repos/wikimedia/hyperswitch/statuses/bea41d2f0b4ec027a1567a03bab018b82216237d"}}}}
{"actor":{"display_login":"Pchelolo"}}