Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-17559] Android: HTTPClient leads to app crash if app is closed before response is received

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2014-08-29T20:57:10.000+0000
Affected Version/sRelease 3.2.3, Release 3.3.0
Fix Version/sRelease 3.4.0
ComponentsAndroid
LabelsTCSupport, android, module_network, qe-automation, qe-testadded
ReporterPhilippe Wueger
AssigneeIngo Muschenetz
Created2014-08-07T12:38:15.000+0000
Updated2014-10-14T18:09:03.000+0000

Description

Problem Description

Android: HTTPClient leads to app crash if app is closed before response is received.

Steps to Reproduce

Run the following app

Close the app via back button immediately after it has started

Wait for a few seconds

The app crashes. On my device this is only visible in the adb log, but I have also seen a crash notice displayed to the user (e.g. on the Genymotion emulator).

var xhr = Titanium.Network.createHTTPClient();
xhr.onload = function() {
	Ti.API.info('Received response');
};
Ti.API.info('Sent request. Waiting for response.');
xhr.open('GET', 'http://httpbin.org/delay/3');
xhr.send();

Actual Results

the app Crashes in genymotion and device.

Logs

See log.txt attachment for crash log.

Attachments

FileDateSize
log.txt2014-08-07T12:38:15.000+000020937

Comments

  1. jithinpv 2014-08-28

    Issue reproduces in Titanium SDK version 3.3.0.GA, 3.2.3.G.A But works fine in Titanium SDK version 3.4.0 master Titanium Studio, build: 3.3.0.201407100905 Titanium Command-Line Interface CLI version 3.3.0, Android device : Motorola Moto G, Android version : 4.4.4
  2. Ingo Muschenetz 2014-08-28

    [~philet] Can you please confirm it as fixed in 3.4.0 CI for you?
  3. Lokesh Choudhary 2014-08-28

    Verified the fix. We do not see any app crash if the app is closed before a response is received. Closing. Environment: Appc Studio : 3.4.0.201408270900 Ti SDK : 3.4.0.v20140827165712 Mac OSX : 10.9.4 Alloy : 1.5.0-dev CLI - 3.4.0-dev Code Processor: 1.1.1 Android 4.2 - Nexus 4
  4. Philippe Wueger 2014-08-29

    {quote} Philippe Wueger Can you please confirm it as fixed in 3.4.0 CI for you? {quote} [~ingo]: Yes, this works now. I see now that this item is a duplicate of TIMOB-16368, which solves the same issue. Thanks for solving this.
  5. Lokesh Choudhary 2014-08-29

    Reopening to add tester

JSON Source