File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed
firebase-sessions/src/main/kotlin/com/google/firebase/sessions Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -90,20 +90,18 @@ constructor(
9090 Log .d(TAG , " App foregrounded on ${getProcessName()} - $sessionData " )
9191
9292 if (shouldInitiateNewSession(sessionData)) {
93- // Generate new session details on main thread so the timestamp is as current as possible
94- val newSessionDetails = sessionGenerator.generateNewSession(sessionData.sessionDetails)
95-
9693 CoroutineScope (backgroundDispatcher).launch {
9794 sessionDataStore.updateData { currentSessionData ->
9895 // Double-check pattern
9996 if (shouldInitiateNewSession(currentSessionData)) {
97+ val newSessionDetails = sessionGenerator.generateNewSession(sessionData.sessionDetails)
98+ sessionFirelogPublisher.mayLogSession(sessionDetails = newSessionDetails)
10099 currentSessionData.copy(sessionDetails = newSessionDetails)
101100 } else {
102101 currentSessionData
103102 }
104103 }
105104 }
106- sessionFirelogPublisher.mayLogSession(sessionDetails = newSessionDetails)
107105 }
108106 }
109107
You can’t perform that action at this time.
0 commit comments