{"action":"created","issue":{"url":"https://api.github.com/repos/webdriverio/webdriverio/issues/402","labels_url":"https://api.github.com/repos/webdriverio/webdriverio/issues/402/labels{/name}","comments_url":"https://api.github.com/repos/webdriverio/webdriverio/issues/402/comments","events_url":"https://api.github.com/repos/webdriverio/webdriverio/issues/402/events","html_url":"https://github.com/webdriverio/webdriverio/issues/402","id":56020940,"number":402,"title":"Promise chain error","user":{"login":"syzer","id":1989646,"avatar_url":"https://avatars.githubusercontent.com/u/1989646?v=3","gravatar_id":"","url":"https://api.github.com/users/syzer","html_url":"https://github.com/syzer","followers_url":"https://api.github.com/users/syzer/followers","following_url":"https://api.github.com/users/syzer/following{/other_user}","gists_url":"https://api.github.com/users/syzer/gists{/gist_id}","starred_url":"https://api.github.com/users/syzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/syzer/subscriptions","organizations_url":"https://api.github.com/users/syzer/orgs","repos_url":"https://api.github.com/users/syzer/repos","events_url":"https://api.github.com/users/syzer/events{/privacy}","received_events_url":"https://api.github.com/users/syzer/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/webdriverio/webdriverio/labels/Bug","name":"Bug","color":"e10c02"},{"url":"https://api.github.com/repos/webdriverio/webdriverio/labels/Project%20Related","name":"Project Related","color":"ffffff"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":21,"created_at":"2015-01-30T11:07:25Z","updated_at":"2015-02-24T20:33:19Z","closed_at":null,"body":"Promise chain error:\r\n```js\r\nclient\r\n            .url(sid.url)\r\n            .then(client.waitFor('.result', 5000))\r\n            .then(client.getValue('#SSID'))\r\n            .then(function(sid){\r\n                 console.log('resolved', sid);  // here gets resolved ass [].length =4\r\n                 return sid;                          // should be a SINGLE element     \r\n             })\r\n```\r\ni guess in this last promise if the would be \r\n10 calls to webdriverio\r\nthe resolved promise would have array of 10 elements.\r\n\r\nright now i workaround this by flattening an array.\r\n\r\n```js\r\nrespSid = _.isArray(respSid) ? _.first(respSid) : respSid;\r\n```\r\n\r\nhelp is very much appreciated\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/webdriverio/webdriverio/issues/comments/75839704","html_url":"https://github.com/webdriverio/webdriverio/issues/402#issuecomment-75839704","issue_url":"https://api.github.com/repos/webdriverio/webdriverio/issues/402","id":75839704,"user":{"login":"syzer","id":1989646,"avatar_url":"https://avatars.githubusercontent.com/u/1989646?v=3","gravatar_id":"","url":"https://api.github.com/users/syzer","html_url":"https://github.com/syzer","followers_url":"https://api.github.com/users/syzer/followers","following_url":"https://api.github.com/users/syzer/following{/other_user}","gists_url":"https://api.github.com/users/syzer/gists{/gist_id}","starred_url":"https://api.github.com/users/syzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/syzer/subscriptions","organizations_url":"https://api.github.com/users/syzer/orgs","repos_url":"https://api.github.com/users/syzer/repos","events_url":"https://api.github.com/users/syzer/events{/privacy}","received_events_url":"https://api.github.com/users/syzer/received_events","type":"User","site_admin":false},"created_at":"2015-02-24T20:33:19Z","updated_at":"2015-02-24T20:33:19Z","body":"ad.Q: ok maybe is now.. it was not the case year or two ago.\r\nalso Q was performing quite poorly in terms of performance in VERY poorly in terms of RAM usage, is it passable now?\r\nalso the thow Error was not passed to .catch()\r\nand also it required calling \r\n.done()\r\nto make sure catch was invoked properly\r\n\r\nok i will PM and try to get your skype and if we find 1 or 2 more guys we will go thru A+ promises.\r\n"}}