{"action":"opened","issue":{"url":"https://api.github.com/repos/lakenen/node-box-view/issues/23","repository_url":"https://api.github.com/repos/lakenen/node-box-view","labels_url":"https://api.github.com/repos/lakenen/node-box-view/issues/23/labels{/name}","comments_url":"https://api.github.com/repos/lakenen/node-box-view/issues/23/comments","events_url":"https://api.github.com/repos/lakenen/node-box-view/issues/23/events","html_url":"https://github.com/lakenen/node-box-view/issues/23","id":187942889,"number":23,"title":"Method uploadURL is not compatible with Bluebird.promisify","user":{"login":"DominikPalo","id":1623257,"avatar_url":"https://avatars.githubusercontent.com/u/1623257?v=3","gravatar_id":"","url":"https://api.github.com/users/DominikPalo","html_url":"https://github.com/DominikPalo","followers_url":"https://api.github.com/users/DominikPalo/followers","following_url":"https://api.github.com/users/DominikPalo/following{/other_user}","gists_url":"https://api.github.com/users/DominikPalo/gists{/gist_id}","starred_url":"https://api.github.com/users/DominikPalo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DominikPalo/subscriptions","organizations_url":"https://api.github.com/users/DominikPalo/orgs","repos_url":"https://api.github.com/users/DominikPalo/repos","events_url":"https://api.github.com/users/DominikPalo/events{/privacy}","received_events_url":"https://api.github.com/users/DominikPalo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-11-08T09:36:10Z","updated_at":"2016-11-08T09:36:10Z","closed_at":null,"body":"I'm using your library in an async-await way - with method `uploadURL` promisified using the Bluebird [promisify method ](http://bluebirdjs.com/docs/api/promise.promisify.html):\r\n\r\n```\r\nconst boxviewJsonResponse = await Bluebird.promisify<any, string, any>(boxViewClient.documents.uploadURL)(publicUrl, options);\r\n```\r\n\r\nIn most cases it works fine, but sometimes it throws an error:\r\n\r\n> Uncaught exception TypeError: Cannot read property 'uploadURL' of undefined at /.../node_modules/box-view/index.js:499:21 at tryOnTimeout (timers.js:224:11) at Timer.listOnTimeout (timers.js:198:5)\r\n\r\nI rewrote it as:\r\n```\r\nconst deferred = Bluebird.defer<any>();\r\nboxViewClient.documents.uploadURL(publicUrl, options, (err: any, jsonData: any, httpResponse: any) => {\r\n    if (err) {\r\n        deferred.reject(err);\r\n    }\r\n    else {\r\n        deferred.resolve(jsonData);\r\n    }\r\n   const boxviewJsonResponse = await deferred.promise;\r\n```\r\n\r\nnow it works fine, but it would be nice to have this method fully compatible also with the first (promisify) approach.\r\n\r\n"}}
{"actor":{"display_login":"DominikPalo"}}