Android Tracker - Session Context fails validation in release mode for first session


I have an issue in release mode with the Android tracker on version 5.6.0 but I have also been able to reproduce it on version 6.0.2

For the first session, the session context has a null previousSessionId, which is normal but in release mode, the previousSessionId field is removed from the json file

This is a json for the session context in debug mode

    "sessionIndex": 1,
    "storageMechanism": "LOCAL_STORAGE",
    "firstEventTimestamp": "2024-03-15T14:00:58.532Z",
    "firstEventId": "d2657f7f-a264-411d-8d87-11f9be3d06d4",
    "sessionId": "2eaf0369-b4e1-48fd-8205-bad3da2a2853",
    "eventIndex": 14,
    "previousSessionId": null,
    "userId": "fbda654c-3aa2-45e8-bd8d-a3b9df66ef39"

This is a json for the session context in release mode

  "sessionIndex": 1,                                    
  "storageMechanism": "LOCAL_STORAGE",                  
  "firstEventTimestamp": "2024-03-15T16:42:27.325Z",    
  "firstEventId": "1c207892-f38b-4357-be09-e8bf61dc3d91"
  "sessionId": "84fb50c7-ef75-4937-afbb-9fbfd7c6d6a7",  
  "eventIndex": 8,                                      
  "userId": "a01f6794-82ad-4542-92c1-b87b3a4bbc7d"      

Thank you

Thanks for the bug report! We’ll take a look

I wasn’t able to replicate this! You could try tracking this event and see if you have the same problem

val event = SelfDescribing(SelfDescribingJson(
        "formId" to "form",
        "elementId" to "element",
        "nodeName" to "INPUT",
        "value" to null

This schema, like the session context one (client_session), has an unfortunate required optional field.

Your app likely is handling JSONs differently in release mode, to remove nulls. Have you configured JSON serialisation anywhere?