{ "id": "82347", "key": "TIMOB-6016", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "11331", "description": "", "name": "Release 1.8.0", "archived": true, "released": true, "releaseDate": "2011-10-31" }, { "id": "12571", "description": "CI for 1_7_X", "name": "Release 1.7.6", "archived": true, "released": false } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-04-02T11:25:59.000+0000", "created": "2011-11-04T12:57:14.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "dr-list", "module_network" ], "versions": [ { "id": "11971", "description": "iOS5 and select Android fixes", "name": "Release 1.7.3", "archived": true, "released": true, "releaseDate": "2011-10-18" } ], "issuelinks": [ { "id": "13777", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "outwardIssue": { "id": "82262", "key": "TIMOB-5969", "fields": { "summary": "iOS: HTTPClient appears to frequently send multiple requests under iOS SDK 5", "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" } }, "priority": { "name": "Critical", "id": "1" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2014-06-19T12:42:43.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": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "With reference to [http request sent twice on ios 5 and mobile sdk 1.7.3|http://developer.appcelerator.com/question/127415/http-request-sent-twice-on-ios-5-and-mobile-sdk-173], we are seeing this as well.\r\n\r\nBelow is an app.js that queries our development server which you can use to reproduce the issue. This works correctly on on iPad 2 running 4.3.5 and iPad 1 running 4.3.5, but duplicate requests are generated on iOS5. See attached screenshot.\r\n\r\n{code:lang=javascript|title=app.js}\r\nvar xhr = Ti.Network.createHTTPClient();\r\nxhr.setTimeout(10000);\r\n\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: \"#fff\",\r\n height: \"100%\",\r\n width: \"100%\"\r\n}),\r\ntop = Ti.UI.createTextArea({\r\n borderWidth: 1,\r\n left: 0,\r\n top: 0,\r\n height: 300,\r\n width: \"100%\",\r\n value: \"\"\r\n}),\r\nbottom = Ti.UI.createTextArea({\r\n borderWidth: 1,\r\n left: 0,\r\n bottom: 0,\r\n height: 300,\r\n width: \"100%\",\r\n value: \"\"\r\n}),\r\nbtn = Ti.UI.createButton({\r\n height: 100,\r\n width: 300,\r\n right: 20,\r\n title: \"make call\"\r\n}),\r\nstats = Ti.UI.createLabel({\r\n left: 20,\r\n height: 200,\r\n width: \"auto\",\r\n text: \"\"\r\n}),\r\ndata = {\r\n clicked: 0,\r\n success: 0,\r\n dupe: 0,\r\n ratio: 0,\r\n events: 0,\r\n calls: 0\r\n};\r\n\r\nwin.add(top);\r\nwin.add(stats);\r\nwin.add(btn);\r\nwin.add(bottom);\r\nwin.open();\r\n\r\nfunction callback(data) { \r\n var msg;\r\n if (data.success) {\r\n msg = \"Success\";\r\n record(\"success\", true);\r\n } else if (!data.success && data.error && data.error == \"duplicate request\") {\r\n msg = \"Error: duplicate request\";\r\n record(\"dupe\", true);\r\n } else\r\n msg = \"Error: Unknown\\ndata: \" + JSON.stringify(data);\r\n \r\n top.value += data.auth + \": \" + msg + \"\\n\";\r\n}\r\nTi.App.addEventListener(\"events/detail\", callback);\r\n \r\nbtn.addEventListener(\"click\", function(e) {\r\n bottom.value += \"call()\\n\";\r\n record(\"events\");\r\n record(\"clicked\");\r\n \r\n call(\"POST\", \"events/detail\", {\r\n eventId: 1,\r\n longitude: -105.24097442626953,\r\n latitude: 39.97970199584961,\r\n appId: 1\r\n });\r\n});\r\n\r\nfunction call(method, uri, data) {\r\n Ti.API.info(\"Network ready state: \" + xhr.readyState);\r\n\r\n var base = \"http://dev.mobilestudying.com:8080\";\r\n var _uri = \"/examjam-1.0/\" + uri;\r\n var timestamp = new Date().getTime();\r\n var contentType = \"application/x-www-form-urlencoded\";\r\n var secret = \"88627d4c72a611e09f3efb27cf9a9621\";\r\n var hash = [method, _uri.split(\"?\", 1)[0], contentType, timestamp, secret];\r\n var auth = Ti.Utils.md5HexDigest(hash.join(\"\\n\"));\r\n \r\n xhr.onload = function() {\r\n var data = this.responseText ? JSON.parse(this.responseText) : null;\r\n data.auth = auth;\r\n //Ti.API.info(\"data: \" + JSON.stringify(data));\r\n Ti.App.fireEvent(uri.split(\"?\")[0], data);\r\n };\r\n xhr.onerror = function(){\r\n Ti.API.debug(\"ERROR: Call failed to '\" + uri + \"': \" + this.responseText);\r\n Ti.API.debug(\"ERROR: data: \" + JSON.stringify(this.responseData));\r\n Ti.API.debug(\"ERROR: status code: \" + this.status);\r\n };\r\n\r\n xhr.open(method, base + _uri);\r\n xhr.setRequestHeader(\"Content-Type\", contentType);\r\n xhr.setRequestHeader(\"X-ExamJam-APIKey\", \"b95a0551553ae446fa39b95f8ffbac26\");\r\n xhr.setRequestHeader(\"Date\", timestamp);\r\n xhr.setRequestHeader(\"Authorization\", auth);\r\n \r\n bottom.value += \"send()\\n\"; \r\n record(\"calls\");\r\n \r\n xhr.send(data);\r\n}\r\nfunction record(value, display) {\r\n data[value]++;\r\n \r\n if (display) {\r\n stats.text = \"Clicked (events/calls): \" + data.clicked + \" (\" + data.events + \"/\" + data.calls + \")\";\r\n stats.text += \"\\nSuccess: \" + data.success;\r\n stats.text += \"\\nDupe (ratio): \" + data.dupe + \" (\" + ((data.dupe / data.success) * 100) + \"%)\";\r\n }\r\n}\r\n{code}", "attachment": [ { "id": "24060", "filename": "app_screenshot.png", "author": { "name": "ryanduval", "key": "ryanduval", "displayName": "Ryan DuVal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-11-05T10:11:20.000+0000", "size": 126872, "mimeType": "image/png" }, { "id": "24059", "filename": "app.js", "author": { "name": "ryanduval", "key": "ryanduval", "displayName": "Ryan DuVal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-11-05T10:11:20.000+0000", "size": 3244, "mimeType": "text/javascript" }, { "id": "24045", "filename": "photo.PNG", "author": { "name": "ryanduval", "key": "ryanduval", "displayName": "Ryan DuVal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-11-04T12:57:14.000+0000", "size": 185874, "mimeType": "image/png" } ], "flagged": false, "summary": "iOS: Http request sent twice on ios 5", "creator": { "name": "ryanduval", "key": "ryanduval", "displayName": "Ryan DuVal", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "ryanduval", "key": "ryanduval", "displayName": "Ryan DuVal", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "* Ti SDK 1.7.3, 1.7.5\r\n* iOS 5.0\r\n* Device: iPad 1", "comment": { "comments": [ { "id": "171531", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Paul, moving this into Titanium Community as this is the best place to triage this. Can you please take a look at this ASAP?", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-11-04T13:03:56.000+0000", "updated": "2011-11-04T13:03:56.000+0000" }, { "id": "171533", "author": { "name": "ryanduval", "key": "ryanduval", "displayName": "Ryan DuVal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I should add that this doesn't happen every single request, but if you click the button 5-10 times, you should see a few.\r\n\r\nCan also confirm this happens in 1.7.5 as well. Just had my manager run it (he has iOS 5) and he reported that \"It started off with 5 straight Success actions, but now every other is a duplicate\".\r\n\r\nFinally, we created a native iOS app with XCode that does exactly the same thing as the provided app and it didn't occur.", "updateAuthor": { "name": "ryanduval", "key": "ryanduval", "displayName": "Ryan DuVal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-11-04T13:06:33.000+0000", "updated": "2011-11-04T14:10:23.000+0000" }, { "id": "171559", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I reproduced this on an iPod Touch running iOS5. Can you determine if the whole call event listener is called twice, or just the HTTP call? This can help you determine if its a flaw with HTTPClient or with adding and removing Ti.App events. \r\n\r\nI think I may have spotted a potential error in the logic. Anytime you click the button, you add a Ti.App listener. The only time you clear if, however, is on a successful onload. If there is an error with your HTTP call, or anything that prevents the onload from firing, you'll end up with multiple instances of your Ti.App listener, resulting in duplicate calls. Try to change up your logic to either tighten up this flow, or move the Ti.App.addEventListener() call outside of the button click altogether, only adding it once.", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-11-04T14:12:56.000+0000", "updated": "2011-11-04T14:12:56.000+0000" }, { "id": "171590", "author": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "body": "Hi Ryan, thank you for bringing this bug to our attention.\r\n\r\nI have moved your issue to the TIMOB project now. Please note the changes that were necessary in order to make this possible, which are described in [How to Submit a Bug Report|http://wiki.appcelerator.org/display/guides/How+to+Submit+a+Bug+Report]. This will avoid any delays for your tickets in future. In particular, note the [JIRA Ticket Checklist|http://wiki.appcelerator.org/display/guides/How+to+Submit+a+Bug+Report#HowtoSubmitaBugReport-JIRATicketChecklist].\r\n\r\nPlease see [Projects Overview|http://wiki.appcelerator.org/display/guides/How+to+Submit+a+Bug+Report#HowtoSubmitaBugReport-ProjectsOverview] for the reason why tickets should be created in the TC project.\r\n\r\nMany thanks", "updateAuthor": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "created": "2011-11-05T11:19:16.000+0000", "updated": "2011-11-05T11:19:16.000+0000" }, { "id": "171595", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This ticket is a duplicate of an issue we are currently in the process of resolving internally. Any commit which solves this other issue will be tagged for this one as well, and we will close it at the appropriate time. We will ensure validation against your provided test as well as the internal one.", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-11-05T11:58:56.000+0000", "updated": "2011-11-05T11:58:56.000+0000" }, { "id": "171599", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I am continually receiving errors of this type from the test:\r\n\r\n{code}\r\nf17d2cfcfd4342ff7dc6bcda788df857: Error: Unknown\r\ndata: {\"type\":\"events/detail\",\"success\":false,\"error\":\"invalid call\",\"auth\":\"f17d2cfcfd4342ff7dc6bcda788df857\"}\r\n{code}\r\n\r\nThis is occurring on both iOS 4.3 and iOS 5.0.", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-11-05T13:20:53.000+0000", "updated": "2011-11-05T13:20:53.000+0000" }, { "id": "171617", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "As requested, the full request being sent over the wire that's generating this error:\r\n\r\n{code}\r\nPOST /examjam-1.0/events/detail HTTP/1.1\r\nHost: dev.mobilestudying.com:8080\r\nUser-Agent: Appcelerator Titanium/0.0.0 (iPad Simulator/5.0; iPhone OS; en_US;)\r\nContent-Length: 73\r\nAccept-Encoding: gzip\r\nX-ExamJam-APIKey: b95a0551553ae446fa39b95f8ffbac26\r\nX-Requested-With: XMLHttpRequest\r\nContent-Type: application/x-www-form-urlencoded; charset=utf-8\r\nAuthorization: 5fd9be99fd194e2879610b17b1d2b90a\r\nDate: 1320529896304\r\nConnection: keep-alive\r\nPragma: no-cache\r\nCache-Control: no-cache\r\n\r\neventId=1&appId=1&longitude=-105.2409744262695&latitude=39.97970199584961\r\n{code}", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-11-05T13:52:34.000+0000", "updated": "2011-11-05T13:52:34.000+0000" }, { "id": "171633", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "NOTE:\r\n\r\nThis failure occurs ONLY in 1.8.0. The difference between the headers appears to be the following:\r\n\r\n{code}\r\nContent-Type: application/x-www-form-urlencoded\r\nvs.\r\nContent-Type: application/x-www-form-urlencoded; charset=utf-8\r\n{code}\r\n\r\nThe server merely needs to be modified to accept the {{charset=utf-8}} information.", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-11-05T14:12:15.000+0000", "updated": "2011-11-05T14:12:15.000+0000" }, { "id": "171639", "author": { "name": "ryanduval", "key": "ryanduval", "displayName": "Ryan DuVal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Fair enough, we can modify our authorization hash to include the charset. You have enough to go off of now?", "updateAuthor": { "name": "ryanduval", "key": "ryanduval", "displayName": "Ryan DuVal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-11-05T14:21:20.000+0000", "updated": "2011-11-05T14:21:20.000+0000" }, { "id": "171642", "author": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "body": "Hi Stephen\r\n\r\nThat was thoughtful of you, about the telephone no. Thank you for doing that! :)\r\n\r\nWe are getting a number of similar reports of problems between xhr and iOS5. Would you mind looking at the following, and letting me know whether existing tickets cover the problems they describe, or whether we need fresh tickets?\r\n\r\nhttp://developer.appcelerator.com/question/127817/getting-an-401-error-on-xhr\r\nhttp://developer.appcelerator.com/question/127816/xhr-not-working-in-ios-5-sdk\r\n\r\n\r\n", "updateAuthor": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "created": "2011-11-05T14:25:40.000+0000", "updated": "2011-11-05T14:25:40.000+0000" }, { "id": "171643", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Ryan -\r\n\r\nNo, I don't have to leave yet. I'll be available for an additional 2-3 hours, working on this problem, and back in the office early tomorrow morning. For now I've been able to disable the charset information coming through in the Content-Type so that I can continue to test, but your server WILL need to be able to process this information as part of POST for when you upgrade to 1.8 (and this will be a recommended upgrade for iOS).\r\n\r\n----\r\n\r\nPaul -\r\n\r\nWithout actual reporting information by those users on those tickets, I can't confirm if they're the same problem. We can't resolve all HTTP issues before 1.8 freeze (scheduled for next week) but revising HTTP support is fast becoming an issue which will be addressed very early in the 1.9 development cycle.", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-11-05T14:31:29.000+0000", "updated": "2011-11-05T14:31:29.000+0000" }, { "id": "171652", "author": { "name": "ryanduval", "key": "ryanduval", "displayName": "Ryan DuVal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Heh. I was just confirming that you have everything you need to dig into it. Appreciate the weekend support!", "updateAuthor": { "name": "ryanduval", "key": "ryanduval", "displayName": "Ryan DuVal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-11-05T14:43:24.000+0000", "updated": "2011-11-05T14:43:24.000+0000" }, { "id": "171673", "author": { "name": "harjit.singh", "key": "harjit.singh", "displayName": "Harjit Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Stephen\r\n\r\n- Please let me know what kind of information do you need to fix this.", "updateAuthor": { "name": "harjit.singh", "key": "harjit.singh", "displayName": "Harjit Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-11-05T15:59:36.000+0000", "updated": "2011-11-05T15:59:36.000+0000" }, { "id": "171674", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Harjit -\r\n\r\nWe've been able to resolve this without any additional information on your part. I'm currently going through, testing how many issues this resolves.\r\n\r\nI've confirmed that it is a bug in iOS 5, regarding an HTTP persistence feature that we take advantage of; turning off this feature is all that's needed to fix it. A pull request will be submitted shortly for us to process internally.", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-11-05T16:06:08.000+0000", "updated": "2011-11-05T16:06:08.000+0000" }, { "id": "171675", "author": { "name": "ryanduval", "key": "ryanduval", "displayName": "Ryan DuVal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Great. Stephen, what is the timeline on the sdk (1.7.3, 1.7.5) being updated?", "updateAuthor": { "name": "ryanduval", "key": "ryanduval", "displayName": "Ryan DuVal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-11-05T16:16:08.000+0000", "updated": "2011-11-05T16:16:08.000+0000" }, { "id": "171676", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Ryan -\r\n\r\nA backport to 1.7.x will need to be discussed internally, but given that this is a critical issue which affects iOS 5, that is likely. The fix should be internally vetted by the end of day (5PM PST) tomorrow.", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-11-05T16:20:47.000+0000", "updated": "2011-11-05T16:20:47.000+0000" }, { "id": "171677", "author": { "name": "ryanduval", "key": "ryanduval", "displayName": "Ryan DuVal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Ok, just keep me in the loop. Will this also result in a unit test being added? How extensive is Appcelerator testing, by the way?", "updateAuthor": { "name": "ryanduval", "key": "ryanduval", "displayName": "Ryan DuVal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-11-05T16:24:56.000+0000", "updated": "2011-11-05T16:24:56.000+0000" }, { "id": "171678", "author": { "name": "harjit.singh", "key": "harjit.singh", "displayName": "Harjit Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Stephen- That's really great. Please let me know when it will be available for download ?", "updateAuthor": { "name": "harjit.singh", "key": "harjit.singh", "displayName": "Harjit Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-11-05T16:30:35.000+0000", "updated": "2011-11-05T16:30:35.000+0000" }, { "id": "171679", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "\r\nHarjit -\r\n\r\nPlease watch this ticket. It will be marked 'resolved' when the pull request is accepted, and 'closed' once QE has verified the fix in the appropriate release. You may also download CI builds from our build server at any time:\r\n\r\nhttp://builds.appcelerator.com.s3.amazonaws.com/index.html\r\n\r\nFixes usually appear in CI ~15-20 minutes after they are accepted and merged by pull request. You may be required to start using master (1.8.0 candidate) to pick up this fix.", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-11-05T16:38:17.000+0000", "updated": "2011-11-05T16:38:17.000+0000" }, { "id": "171701", "author": { "name": "rseagraves", "key": "rseagraves", "displayName": "Reggie Seagraves", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Note: This fix can be merged into 1_7_X easily if necessary.", "updateAuthor": { "name": "rseagraves", "key": "rseagraves", "displayName": "Reggie Seagraves", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-11-06T12:24:00.000+0000", "updated": "2011-11-06T12:24:00.000+0000" }, { "id": "171704", "author": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Let's go ahead and get this in 1.7.6", "updateAuthor": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-11-06T14:44:20.000+0000", "updated": "2011-11-06T14:44:20.000+0000" }, { "id": "171843", "author": { "name": "ryanduval", "key": "ryanduval", "displayName": "Ryan DuVal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Thanks for getting to the bottom of this guys.\r\n\r\nDo we have an ETA on the 1.7.6 release? We're using a custom sdk now internally.", "updateAuthor": { "name": "ryanduval", "key": "ryanduval", "displayName": "Ryan DuVal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-11-07T17:26:50.000+0000", "updated": "2011-11-07T17:26:50.000+0000" }, { "id": "171906", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Ryan -\r\n\r\nThere is unlikely to be an official 1.7.6 release at any point, but I've added this change to our 1_7_X branch, which means you can pick it up from continuous integration within a few minutes.", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-11-08T09:43:09.000+0000", "updated": "2011-11-08T09:43:09.000+0000" }, { "id": "172254", "author": { "name": "harjit.singh", "key": "harjit.singh", "displayName": "Harjit Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I just got 1.7.6 and 1.8.0 after this fix. The 1.8.0 version is filename: mobilesdk-1.8.0.v20111109103101-osx.zip\r\n\r\n and 1.7.6 is mobilesdk-1.7.6.v20111109161100-osx.zip\r\n\r\n\r\n\r\nhttp Basic auth doesn't work on 4.3 and 5.0.\r\n\r\n\r\nI downgraded to 1.7.5 and 4.3 works. 5.0 doesn't work....\r\n\r\n\r\nHere is the code for which we are using for authentication . Let me know if you need anything else for this to make it debug \r\n\r\n\r\n\r\n\r\n\r\n\r\nfunction setPassportCredentials(data) {\r\n\r\n if(data.networkOnline == false) {\r\n doOfflineMode(data);\r\n return;\r\n }\r\n\r\n var xhr = Titanium.Network.createHTTPClient();\r\n Ti.API.info(\"Server:\" + pt.app.CurrentServer());\r\n\r\n xhr.open(\"POST\", pt.app.CurrentServer() + \"/tabulae?r=\" + Date.now());\r\n\r\n // set credentials,\r\n var authstr = 'Basic ' + Titanium.Utils.base64encode(data.username + ':' + data.password);\r\n \r\n \r\n Ti.API.info(\"authstr:\" + authstr);\r\n\r\n \r\n xhr.setRequestHeader('Authorization', authstr);\r\n xhr.setRequestHeader(\"Content-Type\", \"text/html; charset=utf-8\");\r\n\r\n\r\n xhr.onreadystatechange = function(aEvt) {\r\n Ti.API.info(\"onreadystatechange login status \" + xhr.status);\r\n for(var x in xhr.getResponseHeaders()) {\r\n Ti.API.info(\"onreadystatechange cookie \" + xhr.getResponseHeaders()[x]);\r\n\r\n }\r\n \r\n }\r\n xhr.onload = function() {\r\n\r\n Ti.API.info(\"login status \" + xhr.status);\r\n //Ti.API.info(\"login response \" + xhr.responseText);\r\n Ti.API.info(\"cookie \" + xhr.getResponseHeader('Set-Cookie'));\r\n\r\n // this is a hack -- for some reason for the FIRST REQUEST ONLY\r\n // we get a 404 regardless of wether login is successful.\r\n if(xhr.status == '404' && !data.retry) {\r\n Ti.API.info('Retrying once because of 404');\r\n data.retry = true;\r\n setPassportCredentials(data);\r\n return;\r\n }\r\n\r\n if(xhr.status == '302') {\r\n Ti.API.info('Retrying once because of 302');\r\n return;\r\n }\r\n\r\n\t\t\tif(xhr.status == '401' && !data.retry) {\r\n\t\t\t\talert(\"Retry\");\r\n Ti.API.info('Retrying once because of 404');\r\n data.retry = true;\r\n setPassportCredentials(data);\r\n return;\r\n }\r\n\r\n // Save values to prefs\r\n Ti.App.Properties.setString('USERNAME', data.username);\r\n Ti.App.Properties.setString('PASSWORD', data.password);\r\n //var secure_url = \"https://\"+encodeURIComponent(data.username+\":\"+data.password)+\"@\"+pt.app.CurrentServer().substring(8);\r\n var secure_url = \"https://\" + encodeURIComponent(data.username) + \":\" + encodeURIComponent(data.password) + \"@\" + pt.app.CurrentServer().substring(8);\r\n Ti.App.Properties.setString('SECURE_URL', secure_url);\r\n Ti.App.Properties.setString('AUTH_STRING', authstr);\r\n //Ti.App.Properties.setString('COOKIE_STRING', xhr.getResponseHeader('Set-Cookie'));\r\n\r\n Ti.App.fireEvent('app:versionCheck', {\r\n data : data\r\n });\r\n\r\n Ti.App.fireEvent('app:registerdevice', {\r\n data : data\r\n });\r\n\r\n if(!data.keepCurrentWindow) {\r\n pt.app.USER_MODEL.queryUserInformation(data.username, function(userInfo, xhr) {\r\n\r\n pt.app.USER_MODEL.setUserPropertyFromObject(userInfo);\r\n\r\n var needsPasswordReset = userInfo.needsPasswordReset;\r\n Ti.API.info(\"queryUserInformation callback needsPasswordReset [\" + needsPasswordReset + \"]\");\r\n Ti.API.debug(\"queryUserInformation: success \" + pt.app.USER_MODEL.getUserFromProperty());\r\n\r\n // only on success, get the picture\r\n Ti.App.fireEvent('app:queryUserInformation.successful', {\r\n data : xhr.responseText,\r\n \"cookie\" : Ti.App.Properties.getString('COOKIE_STRING')\r\n });\r\n // only on success, get the picture\r\n Ti.App.fireEvent('app:login.successful', {\r\n data : data.username,\r\n mode : 'ONLINE',\r\n needsPasswordReset : needsPasswordReset,\r\n \"cookie\" : Ti.App.Properties.getString('COOKIE_STRING')\r\n\r\n });\r\n });\r\n }\r\n\r\n xhr.abort();\r\n\r\n }\r\n xhr.onerror = function(e) {\r\n Ti.API.debug(\"Location:\" + xhr.getResponseHeader(\"Location\"));\r\n Ti.API.debug(\"Referrer:\" + xhr.getResponseHeader(\"Referer\"));\r\n Ti.App.fireEvent(\"app:http.error\", {\r\n action : 'login',\r\n status : xhr.status,\r\n error : e.error\r\n });\r\n\r\n xhr.abort();\r\n };\r\n Ti.API.info(String.format(\"username [%s] password [%s]\", data.username, data.password));\r\n\r\n // clear all cookies\r\n xhr.setRequestHeader(\"Cookie\", \"PassportID=\");\r\n xhr.setRequestHeader(\"Cookie\", \"PassportKey=\");\r\n xhr.setRequestHeader(\"JSESSIONID\", \"PassportKey=\");\r\n\r\n xhr.send();\r\n\r\n }", "updateAuthor": { "name": "harjit.singh", "key": "harjit.singh", "displayName": "Harjit Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-11-10T16:39:04.000+0000", "updated": "2011-11-10T16:39:04.000+0000" }, { "id": "175226", "author": { "name": "mpettiford", "key": "mpettiford", "displayName": "Michael Pettiford", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested on Ti Studio 1.0.7.201112061404\r\n
Ti Mob SDK 1.8.0.1.v20111207091653\r\n
OSX Lion\r\niPhone 4S OS 5.0.1, iPad 2 OS 5.0\r\n\r\nExpected behavior of no duplicate requests is shown", "updateAuthor": { "name": "mpettiford", "key": "mpettiford", "displayName": "Michael Pettiford", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-12-07T14:29:24.000+0000", "updated": "2011-12-07T14:29:24.000+0000" }, { "id": "175411", "author": { "name": "harjit.singh", "key": "harjit.singh", "displayName": "Harjit Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested with iOS 4.3 and iOs 5 and I can't login. I don't think it fixed the issue which I'm having. ", "updateAuthor": { "name": "harjit.singh", "key": "harjit.singh", "displayName": "Harjit Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-12-08T11:24:24.000+0000", "updated": "2011-12-08T11:24:24.000+0000" }, { "id": "175415", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "If you're still experiencing failures you may need to downgrade your TLS version. This was issue TIMOB-6311, which includes documentation changes.", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-12-08T11:31:04.000+0000", "updated": "2011-12-08T11:31:04.000+0000" }, { "id": "176737", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Harjit -\r\n\r\nYou may also need to upgrade your server to handle the \"charset\" content-type information, as mentioned above.", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-12-20T11:38:20.000+0000", "updated": "2011-12-20T11:38:20.000+0000" }, { "id": "178366", "author": { "name": "dhyde", "key": "dhyde", "displayName": "Dustin Hyde", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Added label qe-port. Test sample does not work due to server problems.", "updateAuthor": { "name": "dhyde", "key": "dhyde", "displayName": "Dustin Hyde", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-01-06T10:57:01.000+0000", "updated": "2012-01-06T12:03:27.000+0000" }, { "id": "189509", "author": { "name": "mpettiford", "key": "mpettiford", "displayName": "Michael Pettiford", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Reopening to add/remove labels", "updateAuthor": { "name": "mpettiford", "key": "mpettiford", "displayName": "Michael Pettiford", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-04-02T11:25:46.000+0000", "updated": "2012-04-02T11:25:46.000+0000" } ], "maxResults": 32, "total": 32, "startAt": 0 } } }