{"action":"created","issue":{"url":"https://api.github.com/repos/snowplow/snowplow-android-tracker/issues/176","labels_url":"https://api.github.com/repos/snowplow/snowplow-android-tracker/issues/176/labels{/name}","comments_url":"https://api.github.com/repos/snowplow/snowplow-android-tracker/issues/176/comments","events_url":"https://api.github.com/repos/snowplow/snowplow-android-tracker/issues/176/events","html_url":"https://github.com/snowplow/snowplow-android-tracker/issues/176","id":116822936,"number":176,"title":"Session context fails on first session","user":{"login":"bernardosrulzon","id":6955526,"avatar_url":"https://avatars.githubusercontent.com/u/6955526?v=3","gravatar_id":"","url":"https://api.github.com/users/bernardosrulzon","html_url":"https://github.com/bernardosrulzon","followers_url":"https://api.github.com/users/bernardosrulzon/followers","following_url":"https://api.github.com/users/bernardosrulzon/following{/other_user}","gists_url":"https://api.github.com/users/bernardosrulzon/gists{/gist_id}","starred_url":"https://api.github.com/users/bernardosrulzon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bernardosrulzon/subscriptions","organizations_url":"https://api.github.com/users/bernardosrulzon/orgs","repos_url":"https://api.github.com/users/bernardosrulzon/repos","events_url":"https://api.github.com/users/bernardosrulzon/events{/privacy}","received_events_url":"https://api.github.com/users/bernardosrulzon/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/snowplow/snowplow-android-tracker/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"jbeemster","id":7984544,"avatar_url":"https://avatars.githubusercontent.com/u/7984544?v=3","gravatar_id":"","url":"https://api.github.com/users/jbeemster","html_url":"https://github.com/jbeemster","followers_url":"https://api.github.com/users/jbeemster/followers","following_url":"https://api.github.com/users/jbeemster/following{/other_user}","gists_url":"https://api.github.com/users/jbeemster/gists{/gist_id}","starred_url":"https://api.github.com/users/jbeemster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbeemster/subscriptions","organizations_url":"https://api.github.com/users/jbeemster/orgs","repos_url":"https://api.github.com/users/jbeemster/repos","events_url":"https://api.github.com/users/jbeemster/events{/privacy}","received_events_url":"https://api.github.com/users/jbeemster/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/snowplow/snowplow-android-tracker/milestones/13","html_url":"https://github.com/snowplow/snowplow-android-tracker/milestones/Version%200.5.3","labels_url":"https://api.github.com/repos/snowplow/snowplow-android-tracker/milestones/13/labels","id":1410822,"number":13,"title":"Version 0.5.3","description":"","creator":{"login":"alexanderdean","id":200511,"avatar_url":"https://avatars.githubusercontent.com/u/200511?v=3","gravatar_id":"","url":"https://api.github.com/users/alexanderdean","html_url":"https://github.com/alexanderdean","followers_url":"https://api.github.com/users/alexanderdean/followers","following_url":"https://api.github.com/users/alexanderdean/following{/other_user}","gists_url":"https://api.github.com/users/alexanderdean/gists{/gist_id}","starred_url":"https://api.github.com/users/alexanderdean/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexanderdean/subscriptions","organizations_url":"https://api.github.com/users/alexanderdean/orgs","repos_url":"https://api.github.com/users/alexanderdean/repos","events_url":"https://api.github.com/users/alexanderdean/events{/privacy}","received_events_url":"https://api.github.com/users/alexanderdean/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":0,"state":"open","created_at":"2015-11-13T18:31:46Z","updated_at":"2015-11-13T18:31:52Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2015-11-13T18:29:40Z","updated_at":"2015-11-13T19:34:23Z","closed_at":null,"body":"Guys -\r\n\r\nI'm seeing a seemingly legitimate row fail the `client_session` validation because its `previousSessionId` is set to an empty string. That happens because the `sessionIndex` is 1 - it's the user's first session.\r\n\r\nPlease find attached the JSON that is failing: [session_context.txt](https://github.com/snowplow/snowplow-android-tracker/files/34224/session_context.txt)\r\n\r\nWhat is the intended behaviour of the field `previousSessionId` on the first session? I guess it's supposed to be null. Should we treat that inside our Android app somehow?"},"comment":{"url":"https://api.github.com/repos/snowplow/snowplow-android-tracker/issues/comments/156536424","html_url":"https://github.com/snowplow/snowplow-android-tracker/issues/176#issuecomment-156536424","issue_url":"https://api.github.com/repos/snowplow/snowplow-android-tracker/issues/176","id":156536424,"user":{"login":"bernardosrulzon","id":6955526,"avatar_url":"https://avatars.githubusercontent.com/u/6955526?v=3","gravatar_id":"","url":"https://api.github.com/users/bernardosrulzon","html_url":"https://github.com/bernardosrulzon","followers_url":"https://api.github.com/users/bernardosrulzon/followers","following_url":"https://api.github.com/users/bernardosrulzon/following{/other_user}","gists_url":"https://api.github.com/users/bernardosrulzon/gists{/gist_id}","starred_url":"https://api.github.com/users/bernardosrulzon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bernardosrulzon/subscriptions","organizations_url":"https://api.github.com/users/bernardosrulzon/orgs","repos_url":"https://api.github.com/users/bernardosrulzon/repos","events_url":"https://api.github.com/users/bernardosrulzon/events{/privacy}","received_events_url":"https://api.github.com/users/bernardosrulzon/received_events","type":"User","site_admin":false},"created_at":"2015-11-13T19:34:23Z","updated_at":"2015-11-13T19:34:23Z","body":"@jbeemster I looked a little bit into this:\r\n\r\n1. The problem seems to live [here](https://github.com/snowplow/snowplow-android-tracker/blob/master/snowplow-android-core/src/main/java/com/snowplowanalytics/snowplow/tracker/Session.java#L233-L239) - this method returns the previous session id or an empty string\r\n2. That happens because the previous session id is updated [here](https://github.com/snowplow/snowplow-android-tracker/blob/master/snowplow-android-core/src/main/java/com/snowplowanalytics/snowplow/tracker/Session.java#L169) to the value of the current session id, which is an [empty string](https://github.com/snowplow/snowplow-android-tracker/blob/master/snowplow-android-core/src/main/java/com/snowplowanalytics/snowplow/tracker/Session.java#L49) on the first session.\r\n\r\nThat's pretty much as far as my Java skills go. I'm updating the session_context schema our our iglu server to remove the uuid validation until the next version comes.\r\n\r\nThanks!"}}