Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-27767] iOS: Parity: httpClient should trigger error callback when url is invalid

GitHub Issuen/a
TypeImprovement
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2020-07-29T21:17:21.000+0000
Affected Version/sRelease 9.0.0, Release 8.3.1
Fix Version/sRelease 9.1.0
ComponentsiOS
Labelseasy-fix, httpclient, parity
ReporterRene Pot
AssigneeVijay Singh
Created2020-02-14T15:25:12.000+0000
Updated2020-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();

Comments

  1. shishir.roy 2020-02-18

    Please provide the update on this inquiry
  2. Rene Pot 2020-02-18

    [~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.
  3. Vijay Singh 2020-03-03

    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
  4. Satyam Sekhri 2020-07-07

    FR Passed
  5. Satyam Sekhri 2020-07-29

    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

JSON Source