{ "id": "65654", "key": "AC-2902", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "8", "description": "", "name": "Needs more info" }, "resolutiondate": "2011-06-10T04:15:12.000+0000", "created": "2011-05-21T05:05:24.000+0000", "labels": [ "HTTPClient", "ios" ], "versions": [], "issuelinks": [], "assignee": { "name": "tguntharp", "key": "tguntharp", "displayName": "Tony Guntharp", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2016-03-08T07:47:52.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "Since a few time, I use to have this issue with my requests:\n{code:javascript}\nError: {\n \"source\":{},\n \"type\":\"error\",\n \"error\":\"Error Domain=ASIHTTPRequestErrorDomain Code=2 \\\"The request\n timed out\\\" UserInfo=0x403e40 {NSLocalizedDescription=The request timed out}\"\n}\n{code}\n\nAnd sometimes, this one (but I don't think it's related to the issue):\n{code:javascript}\nError: {\n \"source\":{},\n \"type\":\"error\",\n \"error\":\"Error Domain=ASIHTTPRequestErrorDomain Code=1 \\\"A connection\n failure occurred\\\" UserInfo=0x51ba60 {NSUnderlyingError=0x559cfc0 \n \\\"The operation couldn't be completed. Operation timed out\\\", \n NSLocalizedDescription=A connection failure occurred}\"\n}\n{code}\n\nBut something strange happens: if I immediately send after a request the same one (that's to say: I don't even wait for the answer of the first one, I IMMEDIATELY send the other one): the first one fails as expected (after the timeout) meanwhile the second works (before the timeout of the first one)!\nThis issue used to happen sometimes.\nBut at the beginning of the week, I have created a request which send an image to my server (the image comes from the camera: e.media):\n{code:javascript}\nvar params = { image: e.media };\nvar xhr = Ti.Network.createHTTPClient();\nxhr.setTimeout(someTimeout); // usually: 30000\nxhr.onload = someOnloadFunction;\nxhr.onerror = someOnerrorFunction;\nxhr.open('POST', url);\nxhr.setRequestHeader('Accept', 'application/json');\nxhr.send(params);\n{code}\nAnd if I do the same thing than before: this request fails each time for the first try but not for the second!\nI also tried to create as the first request the same than the second but without any parameter (so, no image: I just specify the URL and the method). And I have the same result (fail for the first, success for the second).\n\nAny idea why? I really need a solution because I can't do anything if my requests don't work as expected :/\n\nIf it can help, I use ruby on rails on Heroku as a server.\n\nThanks in advance", "attachment": [], "flagged": false, "summary": "HTTPClient and random ASIHTTPRequestErrorDomain", "creator": { "name": "knice", "key": "knice", "displayName": "Romain", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "knice", "key": "knice", "displayName": "Romain", "active": true, "timeZone": "Europe/Berlin" }, "environment": ". build for iOS 4.1\n. sdk 4.2/4.3\n. on iPhone 3G, 3GS, 4, Simulator\n. Titanium 1.6.1, 1.6.2, 1.7.0, 1.7.0 RC1", "comment": { "comments": [ { "id": "134435", "author": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "body": "In order for us to progress this issue, please edit your ticket to include a proper [Use-case|http://wiki.appcelerator.org/display/guides/Contributing+to+Titanium#ContributingtoTitanium-CreatingGoodUsecases].\n\nAlso kindly read the [Submitting Bug Reports|http://wiki.appcelerator.org/display/guides/Contributing+to+Titanium#ContributingtoTitanium-SubmittingBugReports] guide before raising tickets.\n\nThank you", "updateAuthor": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "created": "2011-05-30T03:16:30.000+0000", "updated": "2011-05-30T03:16:30.000+0000" }, { "id": "156422", "author": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "body": "No response from user after request for information. Marking resolved / incomplete.", "updateAuthor": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "created": "2011-06-10T04:15:12.000+0000", "updated": "2011-06-10T04:15:12.000+0000" }, { "id": "163069", "author": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "body": "Closed after 30 days of inactivity.", "updateAuthor": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "created": "2011-08-16T16:44:07.000+0000", "updated": "2011-08-16T16:44:07.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }