braze-inc / braze-react-native-sdk

Public repo for the Braze React Native SDK
https://www.braze.com
Other
64 stars 83 forks source link

[Bug]: React Native - Seeing both Session Start and Session End at the same time. #207

Closed serkanhekimoglu closed 1 year ago

serkanhekimoglu commented 1 year ago

Which Platforms?

Both

Which React Native Version?

0.71.6

Which @braze/react-native-sdk SDK version?

2.1.0

Repro Rate

100% of the time

Steps To Reproduce

Example:

  1. import Braze from "@braze/react-native-sdk".
  2. Braze.changeUser("id")
  3. Run the app.

Expected Behavior

Expecting to see just Session Start event

Actual Incorrect Behavior

Seeing Session Start and Session End event at the same time Screen Shot 2023-04-26 at 15 27 41

Verbose Logs

No response

Additional Information

I should be seeing only Session Start event when I launch application. I have no clue why I am also seeing Session End at the same time without closing or sending app to background.

lowip commented 1 year ago

Hi @serkanhekimoglu,

This is the expected behavior. When launching the application, the SDK measures how much time has passed since the application was last closed and decides whether to start a new session or continue the existing one.

I have no clue why I am also seeing Session End at the same time without closing or sending app to background.

It's not possible for us to send those events when closing or sending the app in the background:

Let me know if you have more questions.