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.
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
[~philet] Can you please confirm it as fixed in 3.4.0 CI for you?
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
{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.
Reopening to add tester