Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-19916] Android: HTTPClient ondatastream method responseText is empty for Android

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2016-02-02T01:34:12.000+0000
Affected Version/sRelease 5.0.2
Fix Version/sRelease 5.2.0
ComponentsAndroid
LabelsCommunity, httpclient, module_network, qe-manualtest, qe-testadded
ReporterCeyhun Kazel
AssigneeAshraf Abu
Created2015-08-31T22:12:04.000+0000
Updated2016-02-02T01:34:45.000+0000

Description

We have comet server which we receive updates. iOS version works but Android version responseText is empty which must not be the case. In iOS version ondatastream method receives ping items but Android does not receive. How to reproduce issue: There are two version app.js (long version) app_simplified.js (short version/ no need to send news to test it) use app.js code as attached. Use iOS simulator then test the service by using following url: [send news update](http://destekmenkul.com/mobil/insertcommenttest.php) fill pass field: pass: murat123 result is shown in the terminal : "its working" means ondatastream works. We sended a news and it cought in ondatastream method but Android gives runtime error because responseText is empty. [INFO] : TypeId:TestType [INFO] : notification:{"py/object":"NewsLib.DefaultNewsItem.DefaultNewsItem","readCount":0,"uid":"20150930141554","source":"TestSource","symbol":"EURUSD","dateTime":{"py/repr":"datetime/datetime.datetime(2015, 9, 30, 14, 15, 54, 430528)"},"thumbnailID":"http://www.forexsirketleri.org/uploads/destekfx-inceleme.png","header":"My Header","typeId":"TestType","keywords":["","usd","abd","eurusd","eur","euro b??lgesi"],"pretext":"pretext","isRefresh":false,"isDelete":false,"stocks":"","timestamp":1446207300000} [INFO] : its working!!! Now try same step with Android simulator there is no info print! ondatastream responseText is empty! I attached our comet service document for further explanation of comet service. app_simplified.js: Just run the code and see the response.

Attachments

FileDateSize
how_to_test_send_news_manually.png2015-09-29T16:21:01.000+0000155530

Comments

  1. Ceyhun Kazel 2015-09-11

    Do you have any update for this issue?
  2. Ceyhun Kazel 2015-09-15

    Hello, we really waiting for a feedback. Could you at least respond whether this issue fixable or not? Thank you.
  3. Amimul Hossain 2015-09-16

    Hello, Can you try Running the below code in SDK 4.1.1.GA. It's working for me in Android. remember "ondatastream" must be called before "open".
       var url = "http://www.7-zip.org/a/7za920.zip";
       var xhr = Ti.Network.createHTTPClient({
       	onload : function(e) {
       		Ti.API.info('success');
       		Ti.API.info('done');
       	},
       	ondatastream : function(e) {
       		Ti.API.info(e.progress);
       	},
       	onerror : function(e) {
       		Ti.API.info('error');
       	},
       	timeout : 5000 
       });
       xhr.open("GET", url);
       xhr.send();
       
  4. Ceyhun Kazel 2015-09-16

    Hi Amimul, I have used the same method with similar way but Android version did not worked. I have send my sample code to your email address. It has sensitive login credentials so I can not share here. We are really waiting whether it can fixable or not. Thank you. Edit: I attached the source code and documents
  5. Ceyhun Kazel 2015-09-17

    Hi, Are there any progress so far?
  6. Ceyhun Kazel 2015-09-28

    Hello, we are waiting response. Thank you.
  7. Ceyhun Kazel 2015-09-28

    Is it possible to assign High or Medium priority to this issue?
  8. Ceyhun Kazel 2015-09-29

    We really need someone to look this issue. Thank you.
  9. Ceyhun Kazel 2015-09-29

    Can someone assign this issue to another developer? We have not received any update yet. Thank you.
  10. Ceyhun Kazel 2015-09-29

    I have added source code, comet server documentation and how to reproduce the issue. Please inform us about this issue as soon as possible we really waited too long without any response.
  11. Ceyhun Kazel 2015-09-30

    I have simplified the app.js code, you need to get following response when you send fake news but Android gets runtime error instead of response: [INFO] : TypeId:TestType [INFO] : notification:{"py/object":"NewsLib.DefaultNewsItem.DefaultNewsItem","readCount":0,"uid":"20150930141554","source":"TestSource","symbol":"EURUSD","dateTime":{"py/repr":"datetime/datetime.datetime(2015, 9, 30, 14, 15, 54, 430528)"},"thumbnailID":"http://www.forexsirketleri.org/uploads/destekfx-inceleme.png","header":"My Header","typeId":"TestType","keywords":["","usd","abd","eurusd","eur","euro bölgesi"],"pretext":"pretext","isRefresh":false,"isDelete":false,"stocks":"","timestamp":1446207300000} [INFO] : its working!!!
  12. Ceyhun Kazel 2015-09-30

    Hello, it is because news is not received by Android, but iOS works smoothly you will not get runtime error with iOS
  13. Ceyhun Kazel 2015-09-30

    It's because opensession.responseText only filled in iOS but not on Android
  14. Ceyhun Kazel 2015-09-30

    I even more simplified the code. You do not need to send news. ResponseText is empty for Android but iOS is not empty. Code is not complicated and issue is really clear.
  15. Ceyhun Kazel 2015-10-01

    Hello Amimul, Thank you for response. Because our customer waiting for Android version and we are already late could you make this ticket high-priority? Thank you.
  16. Ceyhun Kazel 2015-10-02

    Hello Amimul, any update so far? Thank you.
  17. Ceyhun Kazel 2015-10-05

    Hello, any update from engineering team? Thank you.
  18. Ceyhun Kazel 2015-10-06

    Hello, any update from engineering team? Thank you.
  19. Ceyhun Kazel 2015-10-12

    Hello, we reallly need a feedback. I have created the issue 1th of September. Thank you.
  20. Ceyhun Kazel 2015-10-22

    Hello, any advance so far?
  21. Shak Hossain 2015-11-11

    Hi [~ceyhun], We moved this issue to our Engineering queue. Waiting for engineering to schedule this.
  22. Ceyhun Kazel 2015-11-16

    Thank you @Shak Hossain. When will 2015 Sprint 24 SDK start?
  23. Ashraf Abu 2015-12-08

    [~ceyhun] Is there a way to show the example by using "curl" in terminal?
  24. Ceyhun Kazel 2015-12-08

    hello, no curl example. But the there had been some change after I have created the issue (login password api url etc..). So I updated the code as below. Could you try this simplified version? [app.js](https://www.dropbox.com/s/lfwayfcl2pyua5e/app.js?dl=0)
  25. Ceyhun Kazel 2015-12-08

    Running example first iOS then Android reveals the problem clearly.
  26. Ashraf Abu 2015-12-09

    [~ceyhun] thanks for the fast response. I'll try the new simplified version.
  27. Ashraf Abu 2015-12-11

    PR merged for Release 5.2.0.
  28. Lokesh Choudhary 2016-01-20

  29. Ceyhun Kazel 2016-02-01

    Thank you for fixing this issue. Could you delete attachments app_simplified, app.js and COMET_ENG.pdf? These are about private services that our customer have prefer not to be disclosed. I can see that there are other ways to replicate this issue. Thank you.

JSON Source