Amplitude-Kotlin icon indicating copy to clipboard operation
Amplitude-Kotlin copied to clipboard

The session id value is not set

Open KChernenko opened this issue 1 year ago • 7 comments

Summary

Hi, I'm trying to migrate to this brand-new SDK. However, the Session ID property is always -1 despite the following configuration:

Configuration(
   apiKey = "the-key-value"
   optOut = true, // Disable data collection due to GDPR (will be enabled after user consent)
   context = application,
   locationListening = false,
   defaultTracking = DefaultTrackingOptions(
       appLifecycles = false,
       sessions = true,
       deepLinks = false,
       screenViews = false
      )
)

UPD: The event stream has two groups of events: green and blue. The blue ones have a value for the Session ID set correctly, but the green ones have a -1 value. What am I doing wrong? Or maybe I am missing something? Screenshot 2023-10-23 at 22 38 56

KChernenko avatar Oct 23 '23 19:10 KChernenko

Hi @KChernenko, thanks for reporting the issue. Would you mind sharing the link to the event you posted?

qingzhuozhen avatar Oct 23 '23 22:10 qingzhuozhen

@qingzhuozhen, can I do this via private DM?

KChernenko avatar Oct 24 '23 10:10 KChernenko

Hi @KChernenko, it is fine to share the link here since it is behind authentication so others won't be able to access it. Or you can submit via our support if your org is a paying customer.

qingzhuozhen avatar Oct 24 '23 17:10 qingzhuozhen

@qingzhuozhen okay, no problem.

This is the link: https://app.amplitude.com/analytics/betterme/project/231475/search/amplitude_id%3D752794883738

KChernenko avatar Oct 24 '23 19:10 KChernenko

Hi @KChernenko, I found the issue. It is basically for during optOut, some logic from our lifecycle got skipped and then later optIn, the session value is not updated. This is an edge case and we are trying to figure out the best ways to solve it.

qingzhuozhen avatar Oct 26 '23 00:10 qingzhuozhen

@qingzhuozhen Hi! Do you have any updates on the issue?

KChernenko avatar Nov 22 '23 20:11 KChernenko

Hello, I think this issue affects my application as well. My amplitude setup is similar to OP's with optOut set to true initially and set to false later after a successful login and some conditions are met.

Steps to Reproduce:

  1. a current session is in progress with optOut set to false
  2. App is backgrounded
  3. Tap push notification.
  4. Set a user property using amplitude.identify(identify.set(KEY, value))

Expected result: User property can now be seen on the following events.

Actual Result: User property is not attached to the events.

I can provide more information if needed.

satyajitvure91 avatar Jun 10 '24 17:06 satyajitvure91