{"action":"created","issue":{"url":"https://api.github.com/repos/openpermissions/resolution-srv/issues/11","repository_url":"https://api.github.com/repos/openpermissions/resolution-srv","labels_url":"https://api.github.com/repos/openpermissions/resolution-srv/issues/11/labels{/name}","comments_url":"https://api.github.com/repos/openpermissions/resolution-srv/issues/11/comments","events_url":"https://api.github.com/repos/openpermissions/resolution-srv/issues/11/events","html_url":"https://github.com/openpermissions/resolution-srv/pull/11","id":156515572,"number":11,"title":"fixed bug related to redirection when redirect_link_is_set","user":{"login":"bnouvel-wio","id":3405279,"avatar_url":"https://avatars.githubusercontent.com/u/3405279?v=3","gravatar_id":"","url":"https://api.github.com/users/bnouvel-wio","html_url":"https://github.com/bnouvel-wio","followers_url":"https://api.github.com/users/bnouvel-wio/followers","following_url":"https://api.github.com/users/bnouvel-wio/following{/other_user}","gists_url":"https://api.github.com/users/bnouvel-wio/gists{/gist_id}","starred_url":"https://api.github.com/users/bnouvel-wio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bnouvel-wio/subscriptions","organizations_url":"https://api.github.com/users/bnouvel-wio/orgs","repos_url":"https://api.github.com/users/bnouvel-wio/repos","events_url":"https://api.github.com/users/bnouvel-wio/events{/privacy}","received_events_url":"https://api.github.com/users/bnouvel-wio/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"bnouvel-wio","id":3405279,"avatar_url":"https://avatars.githubusercontent.com/u/3405279?v=3","gravatar_id":"","url":"https://api.github.com/users/bnouvel-wio","html_url":"https://github.com/bnouvel-wio","followers_url":"https://api.github.com/users/bnouvel-wio/followers","following_url":"https://api.github.com/users/bnouvel-wio/following{/other_user}","gists_url":"https://api.github.com/users/bnouvel-wio/gists{/gist_id}","starred_url":"https://api.github.com/users/bnouvel-wio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bnouvel-wio/subscriptions","organizations_url":"https://api.github.com/users/bnouvel-wio/orgs","repos_url":"https://api.github.com/users/bnouvel-wio/repos","events_url":"https://api.github.com/users/bnouvel-wio/events{/privacy}","received_events_url":"https://api.github.com/users/bnouvel-wio/received_events","type":"User","site_admin":false},"milestone":null,"comments":2,"created_at":"2016-05-24T14:01:12Z","updated_at":"2016-05-27T09:45:01Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/openpermissions/resolution-srv/pulls/11","html_url":"https://github.com/openpermissions/resolution-srv/pull/11","diff_url":"https://github.com/openpermissions/resolution-srv/pull/11.diff","patch_url":"https://github.com/openpermissions/resolution-srv/pull/11.patch"},"body":"http://bamboo.digicat.io/browse/CHCL-MPT184-4\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/openpermissions/resolution-srv/issues/comments/222105482","html_url":"https://github.com/openpermissions/resolution-srv/pull/11#issuecomment-222105482","issue_url":"https://api.github.com/repos/openpermissions/resolution-srv/issues/11","id":222105482,"user":{"login":"tconway","id":12034521,"avatar_url":"https://avatars.githubusercontent.com/u/12034521?v=3","gravatar_id":"","url":"https://api.github.com/users/tconway","html_url":"https://github.com/tconway","followers_url":"https://api.github.com/users/tconway/followers","following_url":"https://api.github.com/users/tconway/following{/other_user}","gists_url":"https://api.github.com/users/tconway/gists{/gist_id}","starred_url":"https://api.github.com/users/tconway/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tconway/subscriptions","organizations_url":"https://api.github.com/users/tconway/orgs","repos_url":"https://api.github.com/users/tconway/repos","events_url":"https://api.github.com/users/tconway/events{/privacy}","received_events_url":"https://api.github.com/users/tconway/received_events","type":"User","site_admin":false},"created_at":"2016-05-27T09:45:01Z","updated_at":"2016-05-27T09:45:01Z","body":"I'm a bit confused about the reason for moving the `if '{source_id}' not in _link_for_id_type` check to after the querying for source ids.\r\n\r\nIf we have a redirect url which does not relate to a source id (e.g: http://www.gettyimages.co.uk/ for getty images) then performing an extra query to get the source ids seems unnecessary and un-performant. \r\n\r\nWe also run the risk of the resolution redirect erroring if we are trying to redirect a source id/ source id type pair that does not exist, which can be the case for s0 hub keys (Admittedly, this is not supposed to happen, but with the situation we had earlier of the getty data having not been onboarded for whatever reason, we would still want a s0 hubkey to redirect properly). If we definitely want the resolution service to error if presented with a non-valid source id/source id type then we need nicer error handling because at the moment it just throws a mess of an http error on the screen.\r\n\r\nWhat was the bug that this PR is fixing, and how does this achieve it?"}}
{"actor":{"display_login":"tconway"}}