Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-17057] iOS: HTTPClient - responseText is not cleared between two requests

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2014-06-05T20:07:22.000+0000
Affected Version/sRelease 3.3.0
Fix Version/sRelease 3.3.0, Release 3.4.0
ComponentsiOS
Labelsmodule_network, qe-testadded, regression
ReporterJérôme Danthinne
AssigneeVishal Duggal
Created2014-06-01T12:59:29.000+0000
Updated2014-08-04T09:43:47.000+0000

Description

I use the HTTPClient to retrieve new tweets. Since 3.3.0, it seems that the responseText prepends the previous value to the new one, so my JSON parser crashes the app. At the first launch, here's what I get: bq. {"tweets":[{"tweet":{"text":"Our friends @felttip_band have a new single and it's a great one again ! Hooked by the whistling https://t.co/6Wt1vkVhEs","created_time":"20140507112956","guid":"463973998452170752"}}]} But if I try to refresh, here's what I get: bq. {"tweets":[{"tweet":{"text":"Our friends @felttip_band have a new single and it's a great one again ! Hooked by the whistling https://t.co/6Wt1vkVhEs","created_time":"20140507112956","guid":"463973998452170752"}}]}{"tweets":[]} As you can see, the correct response (empty array) is at the end, but the previous value is still there... This does not happen with SDK 3.2.3.

Comments

  1. Ingo Muschenetz 2014-06-02

    Do you have a simple sample that demonstrates the problem we can reuse to make sure we see the same behavior?
  2. Jérôme Danthinne 2014-06-02

    A simple sample, not really, but I can send my app code if needed…
  3. Vishal Duggal 2014-06-05

    Pull pending master - https://github.com/appcelerator/titanium_mobile/pull/5775 3_3_X - https://github.com/appcelerator/titanium_mobile/pull/5776
  4. Satyam Sekhri 2014-06-10

    The response text gets cleared between calls and does not append to the previous response. Verified on: || Component || Version || | Appcelerator Studio | 3.3.0.201406061445 | | Titanium SDK | 3.3.0.RC | | Node | 0.10.28 | | acs | 1.0.14 | | alloy | 1.4.0-beta2 | | npm | 1.4.9 | | CLI | 3.3.0-beta3 | | Titanium-code-processor | 1.1.1 | | OS | OSX 10.9.2 | | Device | iPhone 5S (iOS 7.1) |

JSON Source