[TIMOB-27767] iOS: Parity: httpClient should trigger error callback when url is invalid
| GitHub Issue | n/a |
|---|---|
| Type | Improvement |
| Priority | High |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2020-07-29T21:17:21.000+0000 |
| Affected Version/s | Release 9.0.0, Release 8.3.1 |
| Fix Version/s | Release 9.1.0 |
| Components | iOS |
| Labels | easy-fix, httpclient, parity |
| Reporter | Rene Pot |
| Assignee | Vijay Singh |
| Created | 2020-02-14T15:25:12.000+0000 |
| Updated | 2020-07-29T21:17:21.000+0000 |
Description
When httpClient is initiated with an invalid URL it currently fails silently. Instead, the behavior should be the same as on Android (call the error callback)
Currently, a workaround is to check the URL property is set to
null after calling send
*Expected Result*
Instead, on iOS, error callback should be triggered the same way it is triggered on Android when an invalid URL is provided.
*Test Code*
const url = "https://www.google .com/";
// above url have space after keyword google
const client = Ti.Network.createHTTPClient({
onload: function(e) {
console.log("success");
},
onerror: function(e) {
console.error(e.error);
},
});
client.open("GET", url);
client.send();
Please provide the update on this inquiry
[~shishir.roy] This is an improvement ticket, not a bugfix. It will be scheduled and released in a future update, sooner rather than later, but no promises can be made. Use the workaround provided in the ticket you raised as a solution, not a temporary fix.
PR (titanium sdk) - https://github.com/appcelerator/titanium_mobile/pull/11513 PR (APSHTTPClient) - https://github.com/appcelerator/APSHTTPClient/pull/50 PR (aps_sdk) - https://github.com/appcelerator/aps_sdk/pull/341
FR Passed
Verified on: Mac OS: 10.15.4 SDK: 9.1.0.v20200727104531 Appc CLI: 8.1.0-master.7 JDK: 11.0.4 Node: 10.17.0 Studio: 6.0.0.202005141803 Xcode: 12.0 beta Device: iOS simulator 14.0 beta, 13.5