{"action":"created","issue":{"url":"https://api.github.com/repos/cims-bioko/cims-server/issues/180","repository_url":"https://api.github.com/repos/cims-bioko/cims-server","labels_url":"https://api.github.com/repos/cims-bioko/cims-server/issues/180/labels{/name}","comments_url":"https://api.github.com/repos/cims-bioko/cims-server/issues/180/comments","events_url":"https://api.github.com/repos/cims-bioko/cims-server/issues/180/events","html_url":"https://github.com/cims-bioko/cims-server/issues/180","id":297105837,"number":180,"title":"Device id is not captured despite being sent by client","user":{"login":"batkinson","id":478997,"avatar_url":"https://avatars2.githubusercontent.com/u/478997?v=4","gravatar_id":"","url":"https://api.github.com/users/batkinson","html_url":"https://github.com/batkinson","followers_url":"https://api.github.com/users/batkinson/followers","following_url":"https://api.github.com/users/batkinson/following{/other_user}","gists_url":"https://api.github.com/users/batkinson/gists{/gist_id}","starred_url":"https://api.github.com/users/batkinson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/batkinson/subscriptions","organizations_url":"https://api.github.com/users/batkinson/orgs","repos_url":"https://api.github.com/users/batkinson/repos","events_url":"https://api.github.com/users/batkinson/events{/privacy}","received_events_url":"https://api.github.com/users/batkinson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-14T14:01:41Z","updated_at":"2018-03-02T08:34:56Z","closed_at":null,"author_association":"OWNER","body":"Recent testing of another issue uncovered that the collect client is sending the device id, but it appears that for some reason it's not accessible to our controller during submission. The following is a trace of an HTTP conversation between ODK Collect and CIMS Server showing that Collect is in fact sending the device id as a URL parameter:\r\n\r\n```\r\nHEAD /api/odk/submission?deviceID=android_id%3A56bf76972f2a205a HTTP/1.1\r\nUser-Agent: Dalvik/1.6.0 (Linux; U; Android 4.4.2; Android SDK built for x86 Build/KK) org.odk.collect.android/v1.11.1\r\nX-OpenRosa-Version: 1.0\r\nDate: Wed, 14 Feb 2018 02:27:41 GMT+00:00\r\nHost: 10.0.2.2\r\nConnection: Keep-Alive\r\nAccept-Encoding: gzip,deflate\r\n\r\nHTTP/1.1 401 \r\nWWW-Authenticate: Digest realm=\"CIMS API\" ...\r\nContent-Type: application/json;charset=UTF-8\r\nTransfer-Encoding: chunked\r\nContent-Encoding: gzip\r\nVary: Accept-Encoding\r\nDate: Wed, 14 Feb 2018 14:27:32 GMT\r\n\r\nHEAD /api/odk/submission?deviceID=android_id%3A56bf76972f2a205a HTTP/1.1\r\nUser-Agent: Dalvik/1.6.0 (Linux; U; Android 4.4.2; Android SDK built for x86 Build/KK) org.odk.collect.android/v1.11.1\r\nX-OpenRosa-Version: 1.0\r\nDate: Wed, 14 Feb 2018 02:27:41 GMT+00:00\r\nHost: 10.0.2.2\r\nConnection: Keep-Alive\r\nAccept-Encoding: gzip,deflate\r\nAuthorization: Digest username=\"brent\", realm=\"CIMS API\"...\r\n\r\nHTTP/1.1 204 \r\nX-OpenRosa-Version: 1.0\r\nX-OpenRosa-Accept-Content-Length: 10485760\r\nLocation: http://10.0.2.2/api/odk/submission\r\nDate: Wed, 14 Feb 2018 14:27:32 GMT\r\n\r\nPOST /api/odk/submission HTTP/1.1\r\nUser-Agent: Dalvik/1.6.0 (Linux; U; Android 4.4.2; Android SDK built for x86 Build/KK) org.odk.collect.android/v1.11.1\r\nX-OpenRosa-Version: 1.0\r\nDate: Wed, 14 Feb 2018 02:27:42 GMT+00:00\r\nContent-Length: 919\r\nContent-Type: multipart/form-data; boundary=Bm3tSz8Je7_RWl9YZOr2XGxAblUX8nPRc2OWQ\r\nHost: 10.0.2.2\r\nConnection: Keep-Alive\r\nAccept-Encoding: gzip,deflate\r\nAuthorization: Digest username=\"brent\", realm=\"CIMS API\"...\r\nContent-Disposition: form-data; name=\"xml_submission_file\"; filename=\"Location Evaluation_2018-02-14_09-21-51.xml\"\r\nContent-Type: text/xml; charset=ISO-8859-1\r\nContent-Transfer-Encoding: binary\r\n\r\n<?xml version='1.0' ?><data ...>...</data>\r\n--Bm3tSz8Je7_RWl9YZOr2XGxAblUX8nPRc2OWQ--\r\nHTTP/1.1 201 \r\nX-OpenRosa-Version: 1.0\r\nX-OpenRosa-Accept-Content-Length: 10485760\r\nLocation: http://10.0.2.2/api/odk/submission\r\nContent-Type: text/xml\r\nTransfer-Encoding: chunked\r\nContent-Encoding: gzip\r\nVary: Accept-Encoding\r\nDate: Wed, 14 Feb 2018 14:27:34 GMT\r\n...\r\n```"},"comment":{"url":"https://api.github.com/repos/cims-bioko/cims-server/issues/comments/369856208","html_url":"https://github.com/cims-bioko/cims-server/issues/180#issuecomment-369856208","issue_url":"https://api.github.com/repos/cims-bioko/cims-server/issues/180","id":369856208,"user":{"login":"batkinson","id":478997,"avatar_url":"https://avatars2.githubusercontent.com/u/478997?v=4","gravatar_id":"","url":"https://api.github.com/users/batkinson","html_url":"https://github.com/batkinson","followers_url":"https://api.github.com/users/batkinson/followers","following_url":"https://api.github.com/users/batkinson/following{/other_user}","gists_url":"https://api.github.com/users/batkinson/gists{/gist_id}","starred_url":"https://api.github.com/users/batkinson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/batkinson/subscriptions","organizations_url":"https://api.github.com/users/batkinson/orgs","repos_url":"https://api.github.com/users/batkinson/repos","events_url":"https://api.github.com/users/batkinson/events{/privacy}","received_events_url":"https://api.github.com/users/batkinson/received_events","type":"User","site_admin":false},"created_at":"2018-03-02T08:34:56Z","updated_at":"2018-03-02T08:34:56Z","author_association":"OWNER","body":"It appears that the problem is that Collect sends the `deviceID` parameter for everything *except* the actual submission. Since the CIMS Server api is stateless, we don't have a session to associate the deviceID from the previous HEAD requests to the subsequent submission request. \r\n"}}
{"actor":{"display_login":"batkinson"}}