{"action":"created","issue":{"url":"https://api.github.com/repos/WICG/webusb/issues/45","repository_url":"https://api.github.com/repos/WICG/webusb","labels_url":"https://api.github.com/repos/WICG/webusb/issues/45/labels{/name}","comments_url":"https://api.github.com/repos/WICG/webusb/issues/45/comments","events_url":"https://api.github.com/repos/WICG/webusb/issues/45/events","html_url":"https://github.com/WICG/webusb/issues/45","id":138162283,"number":45,"title":"make setConfiguration more tolerant","user":{"login":"beaufortfrancois","id":634478,"avatar_url":"https://avatars.githubusercontent.com/u/634478?v=3","gravatar_id":"","url":"https://api.github.com/users/beaufortfrancois","html_url":"https://github.com/beaufortfrancois","followers_url":"https://api.github.com/users/beaufortfrancois/followers","following_url":"https://api.github.com/users/beaufortfrancois/following{/other_user}","gists_url":"https://api.github.com/users/beaufortfrancois/gists{/gist_id}","starred_url":"https://api.github.com/users/beaufortfrancois/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beaufortfrancois/subscriptions","organizations_url":"https://api.github.com/users/beaufortfrancois/orgs","repos_url":"https://api.github.com/users/beaufortfrancois/repos","events_url":"https://api.github.com/users/beaufortfrancois/events{/privacy}","received_events_url":"https://api.github.com/users/beaufortfrancois/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-03-03T12:20:58Z","updated_at":"2016-03-08T11:14:07Z","closed_at":null,"body":"It would be better (hear easier) in my opinion if `setConfiguration` would succeed even if the active configuration is already the one we're trying to set.\r\n\r\nFor now, here's what we have to write...\r\n\r\n```javascript\r\ndevice.getConfiguration()\r\n.then(config => {\r\n  if (config.configurationValue == 1) {\r\n    return Promise.resolve();\r\n  } else {\r\n    return Promise.reject();\r\n  }\r\n})\r\n.catch(error => device.setConfiguration(1))\r\n.then(() => { ... })\r\n```\r\n\r\nHow about instead?\r\n\r\n\r\n```javascript\r\ndevice.setConfiguration(1)\r\n.then(() => { ... })\r\n```\r\n\r\nCurrently if I try `device.setConfiguration(1)` while active configuratuion `configurationValue` is 1, I get a \"DOMException: Unable to set device configutation\" error.\r\nAnd my `about:device-log` page says \"Failed to set configuration 1: Resource busy\"."},"comment":{"url":"https://api.github.com/repos/WICG/webusb/issues/comments/193732499","html_url":"https://github.com/WICG/webusb/issues/45#issuecomment-193732499","issue_url":"https://api.github.com/repos/WICG/webusb/issues/45","id":193732499,"user":{"login":"beaufortfrancois","id":634478,"avatar_url":"https://avatars.githubusercontent.com/u/634478?v=3","gravatar_id":"","url":"https://api.github.com/users/beaufortfrancois","html_url":"https://github.com/beaufortfrancois","followers_url":"https://api.github.com/users/beaufortfrancois/followers","following_url":"https://api.github.com/users/beaufortfrancois/following{/other_user}","gists_url":"https://api.github.com/users/beaufortfrancois/gists{/gist_id}","starred_url":"https://api.github.com/users/beaufortfrancois/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beaufortfrancois/subscriptions","organizations_url":"https://api.github.com/users/beaufortfrancois/orgs","repos_url":"https://api.github.com/users/beaufortfrancois/repos","events_url":"https://api.github.com/users/beaufortfrancois/events{/privacy}","received_events_url":"https://api.github.com/users/beaufortfrancois/received_events","type":"User","site_admin":false},"created_at":"2016-03-08T11:14:07Z","updated_at":"2016-03-08T11:14:07Z","body":"Do you think it's reasonable to have this implemented for M51?"}}