{"action":"created","issue":{"url":"https://api.github.com/repos/sahat/satellizer/issues/728","repository_url":"https://api.github.com/repos/sahat/satellizer","labels_url":"https://api.github.com/repos/sahat/satellizer/issues/728/labels{/name}","comments_url":"https://api.github.com/repos/sahat/satellizer/issues/728/comments","events_url":"https://api.github.com/repos/sahat/satellizer/issues/728/events","html_url":"https://github.com/sahat/satellizer/pull/728","id":131846515,"number":728,"title":"Improved popup error handling.","user":{"login":"Martinsos","id":1536647,"avatar_url":"https://avatars.githubusercontent.com/u/1536647?v=3","gravatar_id":"","url":"https://api.github.com/users/Martinsos","html_url":"https://github.com/Martinsos","followers_url":"https://api.github.com/users/Martinsos/followers","following_url":"https://api.github.com/users/Martinsos/following{/other_user}","gists_url":"https://api.github.com/users/Martinsos/gists{/gist_id}","starred_url":"https://api.github.com/users/Martinsos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Martinsos/subscriptions","organizations_url":"https://api.github.com/users/Martinsos/orgs","repos_url":"https://api.github.com/users/Martinsos/repos","events_url":"https://api.github.com/users/Martinsos/events{/privacy}","received_events_url":"https://api.github.com/users/Martinsos/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-06T11:34:22Z","updated_at":"2016-02-17T09:37:40Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/sahat/satellizer/pulls/728","html_url":"https://github.com/sahat/satellizer/pull/728","diff_url":"https://github.com/sahat/satellizer/pull/728.diff","patch_url":"https://github.com/sahat/satellizer/pull/728.patch"},"body":"While trying to resolve the problem that I had (described in https://github.com/sahat/satellizer/issues/727), I figured out that it could be helpful for others to have some better error handling in pollPopup method (it would for sure had saved me some time!).\r\n\r\nThere are two changes.\r\n\r\nFirst one is simple: if popup is closed by somebody else, propagate corresponding error message. Seemed a reasonable thing to do, and I just noticed that there were some requests for it in https://github.com/sahat/satellizer/issues/706. I have the same situation with spinner as those guys, so getting a reject on promise is important in order to inform the user about failed attempt of login.\r\n\r\nSecond one is inspired by https://github.com/sahat/satellizer/issues/727 - I had a situation there where redirect happened but query params were not set. Satellizer continued to do polling forever in that case.\r\nI believe that if we get in such state, where redirect occurred but query parameters are not set, we can safely assume that there is no way to get in state where those query parameters will be set again, so we can stop polling and return appropriate error message.\r\nI also found very similar case in https://github.com/sahat/satellizer/issues/629, so it would be helpful in that case also.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/sahat/satellizer/issues/comments/185117266","html_url":"https://github.com/sahat/satellizer/pull/728#issuecomment-185117266","issue_url":"https://api.github.com/repos/sahat/satellizer/issues/728","id":185117266,"user":{"login":"Martinsos","id":1536647,"avatar_url":"https://avatars.githubusercontent.com/u/1536647?v=3","gravatar_id":"","url":"https://api.github.com/users/Martinsos","html_url":"https://github.com/Martinsos","followers_url":"https://api.github.com/users/Martinsos/followers","following_url":"https://api.github.com/users/Martinsos/following{/other_user}","gists_url":"https://api.github.com/users/Martinsos/gists{/gist_id}","starred_url":"https://api.github.com/users/Martinsos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Martinsos/subscriptions","organizations_url":"https://api.github.com/users/Martinsos/orgs","repos_url":"https://api.github.com/users/Martinsos/repos","events_url":"https://api.github.com/users/Martinsos/events{/privacy}","received_events_url":"https://api.github.com/users/Martinsos/received_events","type":"User","site_admin":false},"created_at":"2016-02-17T09:37:40Z","updated_at":"2016-02-17T09:37:40Z","body":"@sahat I updated it this one to latest changes."}}