{"action":"created","issue":{"url":"https://api.github.com/repos/Automattic/wp-calypso/issues/24296","repository_url":"https://api.github.com/repos/Automattic/wp-calypso","labels_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/24296/labels{/name}","comments_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/24296/comments","events_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/24296/events","html_url":"https://github.com/Automattic/wp-calypso/pull/24296","id":315439792,"number":24296,"title":"Path to Section: rank matches on matched string length","user":{"login":"lsinger","id":23619,"avatar_url":"https://avatars1.githubusercontent.com/u/23619?v=4","gravatar_id":"","url":"https://api.github.com/users/lsinger","html_url":"https://github.com/lsinger","followers_url":"https://api.github.com/users/lsinger/followers","following_url":"https://api.github.com/users/lsinger/following{/other_user}","gists_url":"https://api.github.com/users/lsinger/gists{/gist_id}","starred_url":"https://api.github.com/users/lsinger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lsinger/subscriptions","organizations_url":"https://api.github.com/users/lsinger/orgs","repos_url":"https://api.github.com/users/lsinger/repos","events_url":"https://api.github.com/users/lsinger/events{/privacy}","received_events_url":"https://api.github.com/users/lsinger/received_events","type":"User","site_admin":false},"labels":[{"id":285010018,"url":"https://api.github.com/repos/Automattic/wp-calypso/labels/[Status]%20Needs%20Review","name":"[Status] Needs Review","color":"fbca04","default":false},{"id":285009976,"url":"https://api.github.com/repos/Automattic/wp-calypso/labels/[Type]%20Enhancement","name":"[Type] Enhancement","color":"c7def8","default":false}],"state":"open","locked":false,"assignee":{"login":"lsinger","id":23619,"avatar_url":"https://avatars1.githubusercontent.com/u/23619?v=4","gravatar_id":"","url":"https://api.github.com/users/lsinger","html_url":"https://github.com/lsinger","followers_url":"https://api.github.com/users/lsinger/followers","following_url":"https://api.github.com/users/lsinger/following{/other_user}","gists_url":"https://api.github.com/users/lsinger/gists{/gist_id}","starred_url":"https://api.github.com/users/lsinger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lsinger/subscriptions","organizations_url":"https://api.github.com/users/lsinger/orgs","repos_url":"https://api.github.com/users/lsinger/repos","events_url":"https://api.github.com/users/lsinger/events{/privacy}","received_events_url":"https://api.github.com/users/lsinger/received_events","type":"User","site_admin":false},"assignees":[{"login":"lsinger","id":23619,"avatar_url":"https://avatars1.githubusercontent.com/u/23619?v=4","gravatar_id":"","url":"https://api.github.com/users/lsinger","html_url":"https://github.com/lsinger","followers_url":"https://api.github.com/users/lsinger/followers","following_url":"https://api.github.com/users/lsinger/following{/other_user}","gists_url":"https://api.github.com/users/lsinger/gists{/gist_id}","starred_url":"https://api.github.com/users/lsinger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lsinger/subscriptions","organizations_url":"https://api.github.com/users/lsinger/orgs","repos_url":"https://api.github.com/users/lsinger/repos","events_url":"https://api.github.com/users/lsinger/events{/privacy}","received_events_url":"https://api.github.com/users/lsinger/received_events","type":"User","site_admin":false}],"milestone":null,"comments":0,"created_at":"2018-04-18T11:26:41Z","updated_at":"2018-04-18T11:26:43Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/24296","html_url":"https://github.com/Automattic/wp-calypso/pull/24296","diff_url":"https://github.com/Automattic/wp-calypso/pull/24296.diff","patch_url":"https://github.com/Automattic/wp-calypso/pull/24296.patch"},"body":"`pathToSection` maps a URL to a Calypso section. Previously, it failed for deeper paths (`/me/account` was matched to `me` instead of `account`) and failed for paths started with the same substring (`/media` was matched to `me` instead of `media`). \r\n\r\nThis PR adds failing tests for both issues in ba11c42 and 213772b and fixes it in 2026aa7. \r\n\r\nTo test:\r\n- read and run the test and make sure the result is what you'd expect (e.g. `npm run test-client client/lib/path-to-section/test/index.js`)"},"comment":{"url":"https://api.github.com/repos/Automattic/wp-calypso/issues/comments/382354713","html_url":"https://github.com/Automattic/wp-calypso/pull/24296#issuecomment-382354713","issue_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/24296","id":382354713,"user":{"login":"matticbot","id":18333116,"avatar_url":"https://avatars2.githubusercontent.com/u/18333116?v=4","gravatar_id":"","url":"https://api.github.com/users/matticbot","html_url":"https://github.com/matticbot","followers_url":"https://api.github.com/users/matticbot/followers","following_url":"https://api.github.com/users/matticbot/following{/other_user}","gists_url":"https://api.github.com/users/matticbot/gists{/gist_id}","starred_url":"https://api.github.com/users/matticbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matticbot/subscriptions","organizations_url":"https://api.github.com/users/matticbot/orgs","repos_url":"https://api.github.com/users/matticbot/repos","events_url":"https://api.github.com/users/matticbot/events{/privacy}","received_events_url":"https://api.github.com/users/matticbot/received_events","type":"User","site_admin":false},"created_at":"2018-04-18T11:26:43Z","updated_at":"2018-04-18T11:26:43Z","author_association":"NONE","body":"Test live: https://calypso.live/?branch=fix/path-to-section-greediness"}}
{"actor":{"display_login":"matticbot"}}