{ "id": "140537", "key": "AC-1241", "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": "5", "description": "All attempts at reproducing this issue failed, or not enough information was available to reproduce the issue. Reading the code produces no clues as to why this behavior would occur. If more information appears later, please reopen the issue.", "name": "Cannot Reproduce" }, "resolutiondate": "2015-02-03T15:01:26.000+0000", "created": "2014-11-25T20:55:57.000+0000", "labels": [ "TCSupportTriage" ], "versions": [], "issuelinks": [], "assignee": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "updated": "2016-03-08T07:37:37.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": [], "description": "On 11/23/2014, query would return success on a user who had not confirmed. On 11/24/2014, the same query would fail. On 11/25/2014, the behavior reverted. \r\n\r\nWhat is going on?\r\n\r\nCould you supply methods to determine the state of a user so that my code can be independent of changes in ACS?\r\n\r\nStates: does not exist, exists but has not confirmed, exists and has confirmed.\r\n\r\n", "attachment": [], "flagged": false, "summary": "Ti.Cloud.Users.query has changed without warning", "creator": { "name": "mitch.starnes@bnsf.com", "key": "mitch.starnes@bnsf.com", "displayName": "Mitch Starnes", "active": true, "timeZone": "America/Chicago" }, "subtasks": [], "reporter": { "name": "mitch.starnes@bnsf.com", "key": "mitch.starnes@bnsf.com", "displayName": "Mitch Starnes", "active": true, "timeZone": "America/Chicago" }, "environment": "ACS", "comment": { "comments": [ { "id": "339204", "author": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "body": "Hi,\r\n\r\nYou can query a user who had not confirmed. \r\nThe only difference between confirmed or non confirmed users is: there is one property like \"confirmed_at\": \"2015-01-15T07:59:03+0000\" in response of confirm user, but not in non-confirmed user.\r\n\r\nHope this will help you.\r\n\r\nRegards,\r\nShuo\r\n", "updateAuthor": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "created": "2015-01-15T08:21:43.000+0000", "updated": "2015-01-15T08:21:43.000+0000" }, { "id": "339233", "author": { "name": "mitch.starnes@bnsf.com", "key": "mitch.starnes@bnsf.com", "displayName": "Mitch Starnes", "active": true, "timeZone": "America/Chicago" }, "body": "Something changed the behavior of how I check to see if a user is confirmed or not. The changes happened in ACS around the 11/24/2014 and 11/25/2014. There were two changes; both changes broke my app. \r\n\r\nHere is my diff showing the code changes I had to make:\r\n\r\n if( typeof user.confirmed_at !== \"undefined\" ) {\r\n Ti.API.info(\"user confirmed at: \" + user.confirmed_at);\r\n userRegObj.user_status = 1;\r\n+\t } else {\r\n \t // 11/24/14 MAS: RECENT ACS CHANGE BROKE THIS\r\n \t //} else {\r\n \t // Ti.API.info(\"user is not confirmed\");\r\n \t // userRegObj.user_status = 0;\r\n- }\r\n+\t // 11/25/14 now it's back the way it was\r\n+\t\t\t\t\tTi.API.info(\"user is not confirmed\");\r\n+\t\t\t\t\tuserRegObj.user_status = 0;\r\n+\t\t\t\t}\r\n\r\nHere is what the code looks like now:\r\n\r\n Cloud.Users.query({\r\n where: {\r\n username: username\r\n }\r\n }, function (e) {\r\n Ti.API.info(\"queryUser e: \" + JSON.stringify(e));\r\n var users = e.users;\r\n// if( e.success === true && typeof e.users[0] !== \"undefined\" ) {\r\n if( e.success === true && e.users.length === 1 ) {\r\n Ti.API.info(\"Cloud.Users.query success\");\r\n var user = e.users[0];\r\n Ti.API.info(JSON.stringify(user));\r\n if( typeof user.confirmed_at !== \"undefined\" ) {\r\n Ti.API.info(\"user confirmed at: \" + user.confirmed_at);\r\n userRegObj.user_status = 1;\r\n\t } else {\r\n\t // 11/24/14 MAS: RECENT ACS CHANGE BROKE THIS\r\n\t //} else {\r\n\t // Ti.API.info(\"user is not confirmed\");\r\n\t // userRegObj.user_status = 0;\r\n\t // 11/25/14 now it's back the way it was\r\n\t\t\t\t\tTi.API.info(\"user is not confirmed\");\r\n\t\t\t\t\tuserRegObj.user_status = 0;\r\n\t\t\t\t}\r\n } else if( e.success === false && e.code === 401 ){\r\n\t\t\t\t// [INFO] : queryUser e: {\"success\":false,\"error\":true,\"code\":401,\"message\":\"You have to confirm your account before continuing.\"}\r\n Ti.API.info(\"user is not confirmed\");\r\n userRegObj.user_status = 0;\r\n }\r\n if (typeof callback === \"function\") {\r\n Ti.API.info('Calling callback from queryUser');\r\n callback({user_status : userRegObj.user_status});\r\n }\r\n });\r\n", "updateAuthor": { "name": "mitch.starnes@bnsf.com", "key": "mitch.starnes@bnsf.com", "displayName": "Mitch Starnes", "active": true, "timeZone": "America/Chicago" }, "created": "2015-01-15T15:45:55.000+0000", "updated": "2015-01-15T15:45:55.000+0000" }, { "id": "339352", "author": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "body": "Sorry for your convenience, ACS USER Object should be stable as you can query non-confirmed user now. \r\nBut you should notice that like I had commented on your \"resendConfirmation\" ticket, You can't do query API when you login a non_confirmed user(like just create a new one). It will give a a \"You have to confirm your account before continuing.\" message. ", "updateAuthor": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "created": "2015-01-16T00:20:52.000+0000", "updated": "2015-01-16T00:20:52.000+0000" }, { "id": "339433", "author": { "name": "mitch.starnes@bnsf.com", "key": "mitch.starnes@bnsf.com", "displayName": "Mitch Starnes", "active": true, "timeZone": "America/Chicago" }, "body": "Can you give me the date this was permanently fixed?", "updateAuthor": { "name": "mitch.starnes@bnsf.com", "key": "mitch.starnes@bnsf.com", "displayName": "Mitch Starnes", "active": true, "timeZone": "America/Chicago" }, "created": "2015-01-16T17:11:19.000+0000", "updated": "2015-01-16T17:11:19.000+0000" }, { "id": "339577", "author": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "body": "Actually, This behave should be alway like what I mentioned. On 11/24, it could be an accident during a cloud update, that is why the behave revert back to normal on 11/25, so you can use query API safely.", "updateAuthor": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "created": "2015-01-17T02:16:15.000+0000", "updated": "2015-01-17T02:16:15.000+0000" }, { "id": "341826", "author": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "body": "Working as expected now. ", "updateAuthor": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "created": "2015-02-03T15:01:26.000+0000", "updated": "2015-02-03T15:01:26.000+0000" } ], "maxResults": 7, "total": 7, "startAt": 0 } } }