{"action":"created","issue":{"url":"https://api.github.com/repos/phonegap/phonegap-app-desktop/issues/811","repository_url":"https://api.github.com/repos/phonegap/phonegap-app-desktop","labels_url":"https://api.github.com/repos/phonegap/phonegap-app-desktop/issues/811/labels{/name}","comments_url":"https://api.github.com/repos/phonegap/phonegap-app-desktop/issues/811/comments","events_url":"https://api.github.com/repos/phonegap/phonegap-app-desktop/issues/811/events","html_url":"https://github.com/phonegap/phonegap-app-desktop/issues/811","id":236509805,"number":811,"title":"If user app proxies URLs (does CORS), certain proxied-URL behaviours can trigger error flows in the Desktop App","user":{"login":"filmaj","id":52645,"avatar_url":"https://avatars3.githubusercontent.com/u/52645?v=3","gravatar_id":"","url":"https://api.github.com/users/filmaj","html_url":"https://github.com/filmaj","followers_url":"https://api.github.com/users/filmaj/followers","following_url":"https://api.github.com/users/filmaj/following{/other_user}","gists_url":"https://api.github.com/users/filmaj/gists{/gist_id}","starred_url":"https://api.github.com/users/filmaj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/filmaj/subscriptions","organizations_url":"https://api.github.com/users/filmaj/orgs","repos_url":"https://api.github.com/users/filmaj/repos","events_url":"https://api.github.com/users/filmaj/events{/privacy}","received_events_url":"https://api.github.com/users/filmaj/received_events","type":"User","site_admin":false},"labels":[{"id":67682162,"url":"https://api.github.com/repos/phonegap/phonegap-app-desktop/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"open","locked":false,"assignee":{"login":"surajpindoria","id":6467569,"avatar_url":"https://avatars1.githubusercontent.com/u/6467569?v=3","gravatar_id":"","url":"https://api.github.com/users/surajpindoria","html_url":"https://github.com/surajpindoria","followers_url":"https://api.github.com/users/surajpindoria/followers","following_url":"https://api.github.com/users/surajpindoria/following{/other_user}","gists_url":"https://api.github.com/users/surajpindoria/gists{/gist_id}","starred_url":"https://api.github.com/users/surajpindoria/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/surajpindoria/subscriptions","organizations_url":"https://api.github.com/users/surajpindoria/orgs","repos_url":"https://api.github.com/users/surajpindoria/repos","events_url":"https://api.github.com/users/surajpindoria/events{/privacy}","received_events_url":"https://api.github.com/users/surajpindoria/received_events","type":"User","site_admin":false},"assignees":[{"login":"surajpindoria","id":6467569,"avatar_url":"https://avatars1.githubusercontent.com/u/6467569?v=3","gravatar_id":"","url":"https://api.github.com/users/surajpindoria","html_url":"https://github.com/surajpindoria","followers_url":"https://api.github.com/users/surajpindoria/followers","following_url":"https://api.github.com/users/surajpindoria/following{/other_user}","gists_url":"https://api.github.com/users/surajpindoria/gists{/gist_id}","starred_url":"https://api.github.com/users/surajpindoria/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/surajpindoria/subscriptions","organizations_url":"https://api.github.com/users/surajpindoria/orgs","repos_url":"https://api.github.com/users/surajpindoria/repos","events_url":"https://api.github.com/users/surajpindoria/events{/privacy}","received_events_url":"https://api.github.com/users/surajpindoria/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/phonegap/phonegap-app-desktop/milestones/52","html_url":"https://github.com/phonegap/phonegap-app-desktop/milestone/52","labels_url":"https://api.github.com/repos/phonegap/phonegap-app-desktop/milestones/52/labels","id":2488997,"number":52,"title":"0.4.5 bug fixes, remove keen analtyics","description":"","creator":{"login":"hermwong","id":107754,"avatar_url":"https://avatars2.githubusercontent.com/u/107754?v=3","gravatar_id":"","url":"https://api.github.com/users/hermwong","html_url":"https://github.com/hermwong","followers_url":"https://api.github.com/users/hermwong/followers","following_url":"https://api.github.com/users/hermwong/following{/other_user}","gists_url":"https://api.github.com/users/hermwong/gists{/gist_id}","starred_url":"https://api.github.com/users/hermwong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hermwong/subscriptions","organizations_url":"https://api.github.com/users/hermwong/orgs","repos_url":"https://api.github.com/users/hermwong/repos","events_url":"https://api.github.com/users/hermwong/events{/privacy}","received_events_url":"https://api.github.com/users/hermwong/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":3,"state":"open","created_at":"2017-04-28T20:47:08Z","updated_at":"2017-06-19T17:42:36Z","due_on":null,"closed_at":null},"comments":0,"created_at":"2017-06-16T15:04:08Z","updated_at":"2017-06-19T17:47:34Z","closed_at":null,"body":"This error is over 50% of all errors being logged in our analytics for the desktop app at this point. I think that makes it high priority!\r\n\r\nThe error logged in analytics is as follows:\r\n\r\n```\r\nRangeError: Invalid status code: 0\r\n at ServerResponse.writeHead %28_http_server.js:195:11%29\r\n at error %28C:\\Program Files %28x86%29\\Adobe\\PhoneGap\\PhoneGap Desktop\\resources\\app.asar.unpacked\\node_modules\\connect-phonegap\\lib\\middleware\\proxy.js:37:25%29\r\n at ClientRequest.proxyError %28C:\\Program Files %28x86%29\\Adobe\\PhoneGap\\PhoneGap Desktop\\resources\\app.asar.unpacked\\node_modules\\http-proxy\\lib\\http-proxy\\passes\\web-incoming.js:146:9%29\r\n at emitOne %28events.js:101:20%29 at ClientRequest.emit %28events.js:188:7%29\r\n at Socket.socketCloseListener %28_http_client.js:285:9%29\r\n at emitOne %28events.js:101:20%29\r\n at Socket.emit %28events.js:188:7%29\r\n at TCP._handle.close [as _onclose] %28net.js:501:12%29\r\n```\r\n\r\nThere are two problems in this issue.\r\n\r\n# Problem 1\r\n\r\nWe are using a version of connect-phonegap that has some issues with proxying. The issues in particular are logged here:\r\n - https://github.com/phonegap/connect-phonegap/issues/197\r\n - https://github.com/phonegap/connect-phonegap/issues/191\r\n\r\nNote that the latest master of connect-phonegap has solved these issues. One path forward is:\r\na) do a new connect-phonegap release\r\nb) do a new phonegap-cli release with the latest connect-phonegap release\r\nc) update the version of phonegap-cli in the desktop app and do a new release\r\n\r\n# Problem 2\r\n\r\nThere are still some problems even when I update my local copies to the latest versions. In particular, if one tries to proxy a bogus URL, that seems to trigger another exception in the desktop app:\r\n\r\n```\r\nserver-status.js:61 Proxy error for url: http://sdkjhfsadsd.com/blah\r\nserver-status.js:75 undefined\r\nserver-status.js:99 Uncaught TypeError: Cannot read property 'indexOf' of undefined\r\n    at parsePortNumber (server-status.js:99)\r\n    at checkMessageType (server-status.js:85)\r\n    at formatServerErrorMessages (server-status.js:76)\r\n    at PhoneGap.<anonymous> (server-status.js:63)\r\n    at emitOne (events.js:101)\r\n    at PhoneGap.emit (events.js:188)\r\n    at Server._errorHandler (/Users/maj/src/phonegap-app-desktop/www/node_modules/phonegap/lib/phonegap/serve.js:102)\r\n    at emitTwo (events.js:111)\r\n    at Server.emit (events.js:191)\r\n    at EventEmitter.<anonymous> (/Users/maj/src/phonegap-app-desktop/www/node_modules/connect-phonegap/lib/serve.js:170)\r\n```\r\n\r\nLooks to be caused by `server-status.js` trying to parse port numbers for error message formatting. However, the error handler for `global.phonegap.serve` is passed an undefined error object. Thus, the port formatting code has no error message to parse, and blows up.\r\n\r\n# Recommended Next Steps\r\n\r\n - update connect-phonegap version inside desktop app as per steps laid out above\r\n - understand why the phonegap-serve error handler is passed an empty error object for the proxy-bogus-url case and fix it. "},"comment":{"url":"https://api.github.com/repos/phonegap/phonegap-app-desktop/issues/comments/309515029","html_url":"https://github.com/phonegap/phonegap-app-desktop/issues/811#issuecomment-309515029","issue_url":"https://api.github.com/repos/phonegap/phonegap-app-desktop/issues/811","id":309515029,"user":{"login":"surajpindoria","id":6467569,"avatar_url":"https://avatars1.githubusercontent.com/u/6467569?v=3","gravatar_id":"","url":"https://api.github.com/users/surajpindoria","html_url":"https://github.com/surajpindoria","followers_url":"https://api.github.com/users/surajpindoria/followers","following_url":"https://api.github.com/users/surajpindoria/following{/other_user}","gists_url":"https://api.github.com/users/surajpindoria/gists{/gist_id}","starred_url":"https://api.github.com/users/surajpindoria/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/surajpindoria/subscriptions","organizations_url":"https://api.github.com/users/surajpindoria/orgs","repos_url":"https://api.github.com/users/surajpindoria/repos","events_url":"https://api.github.com/users/surajpindoria/events{/privacy}","received_events_url":"https://api.github.com/users/surajpindoria/received_events","type":"User","site_admin":false},"created_at":"2017-06-19T17:47:34Z","updated_at":"2017-06-19T17:47:34Z","body":"@filmaj I will start taking a look at this today. As for \"Problem 2\", is this the same as https://github.com/phonegap/connect-phonegap/issues/191? If so, curious why this is an issue in the desktop only and not through the CLI as well."}}
{"actor":{"display_login":"surajpindoria"}}