Skip to content

Commit

Permalink
default the prev session to be invalid in a new app install
Browse files Browse the repository at this point in the history
Background:
Each session has an `isValid` property that is read at the start of a potential new session. If this value read is `false`, then a new session will start and its property is set to `true`. If this value read is `true`, that means we continue on this same previous session.
At the end of the session, this property will be set to `false`.

Problem:
On a brand new app install, we were defaulting this value to `true`, which means the logic to trigger a new session will not happen, since the SDK will believe it should continue from a previous session. However, this is the first time the app is opened after a new install.

Solution:
By defaulting instead to `false`, we ensure that this first app open will start a new session. In addition, this will trigger a `TRACK_SESSION_START` operation and ask the server to `refresh_device_metadata`, updating country and IP for this user.
  • Loading branch information
nan-li committed Nov 7, 2023
1 parent ff841f9 commit 4157b33
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class SessionModel : Model() {
* Whether the session is valid.
*/
var isValid: Boolean
get() = getBooleanProperty(::isValid.name) { true }
get() = getBooleanProperty(::isValid.name) { false }
set(value) {
setBooleanProperty(::isValid.name, value)
}
Expand Down

0 comments on commit 4157b33

Please sign in to comment.