Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-9608] MobileWeb: Ti.Network.HTTPClient aborts when making async request

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2012-06-18T09:57:48.000+0000
Affected Version/sRelease 2.1.0
Fix Version/sRelease 2.1.0, Sprint 2012-13 MW
ComponentsMobileWeb
Labelsn/a
ReporterJeff English
AssigneeChris Barber
Created2012-06-18T08:54:31.000+0000
Updated2017-03-04T00:10:54.000+0000

Description

When making an asynchronous HTTP request, the request aborts immediately after the 'send' call. The reason is that the setTimeout call is not setting a timeout value due to incorrect parenthesis. At line 115 in HTTPClient.js, the following code:
timeout && (this._timeoutTimer = setTimeout(lang.hitch(this, function() {
	if (this.connected) {
		this.abort();
		!this._completed && this._onError("Request timed out");
	}
}, timeout)));
should be
timeout && (this._timeoutTimer = setTimeout(lang.hitch(this, function() {
	if (this.connected) {
		this.abort();
		!this._completed && this._onError("Request timed out");
	}
}), timeout));
[Notice the change in the closing parentheses]

Comments

  1. Chris Barber 2012-06-18

    Pull request: https://github.com/appcelerator/titanium_mobile/pull/2417
  2. Lee Morris 2017-03-04

    Closing ticket due to MobileWeb no longer being supported.

JSON Source