Add parameter wasLastSession to SessionListener.onSessionDeleted

This commit is contained in:
Benoit Marty
2025-10-23 16:20:15 +02:00
parent 0b9a4a6302
commit 44e125dbc7
13 changed files with 15 additions and 14 deletions

View File

@@ -79,7 +79,7 @@ class DefaultAnalyticsService(
// Nothing to do
}
override suspend fun onSessionDeleted(userId: String) {
override suspend fun onSessionDeleted(userId: String, wasLastSession: Boolean) {
// Delete the store when the last session is deleted
if (sessionStore.getAllSessions().isEmpty()) {
analyticsStore.reset()

View File

@@ -178,7 +178,7 @@ class DefaultAnalyticsServiceTest {
coroutineScope = backgroundScope,
analyticsStore = store,
)
sut.onSessionDeleted("userId")
sut.onSessionDeleted("userId", false)
resetLambda.assertions().isCalledOnce()
}