Wraps `CommonTokenDataStore.clearTokens()` in the existing `refreshMutex`, serializing logout against any in-flight `refreshAccessToken()` call (which already holds the same mutex for its full HTTP duration). Without this, a refresh completing successfully after `clearTokens()` would silently resurrect the just-killed session by writing a fresh token to disk. A private `clearTokensLocked()` helper holds the inner clear logic and is called from inside `refreshAccessToken()` to avoid self-deadlock on the non-reentrant mutex.
43 lines
1.4 KiB
Text
43 lines
1.4 KiB
Text
plugins {
|
|
id("librechat.kmp.library")
|
|
id("librechat.kmp.koin")
|
|
id("librechat.kmp.room")
|
|
id("librechat.kotlin.serialization")
|
|
}
|
|
|
|
android {
|
|
namespace = "com.garfiec.librechat.core.data"
|
|
}
|
|
|
|
kotlin {
|
|
sourceSets {
|
|
commonMain.dependencies {
|
|
implementation(project(":core:network"))
|
|
implementation(project(":core:model"))
|
|
implementation(project(":core:common"))
|
|
implementation(libs.datastore.preferences)
|
|
implementation(libs.ktor.client.core)
|
|
implementation(libs.ktor.client.content.negotiation)
|
|
implementation(libs.ktor.serialization.kotlinx.json)
|
|
implementation(libs.ktor.client.logging)
|
|
implementation(libs.kotlinx.serialization.json)
|
|
implementation(libs.kotlinx.datetime)
|
|
implementation(libs.kermit)
|
|
}
|
|
androidMain.dependencies {
|
|
implementation(libs.koin.android)
|
|
implementation(libs.security.crypto)
|
|
}
|
|
named("androidUnitTest").dependencies {
|
|
implementation(libs.koin.test)
|
|
implementation(libs.ktor.client.mock)
|
|
}
|
|
named("androidInstrumentedTest").dependencies {
|
|
implementation(libs.room.testing)
|
|
implementation(libs.truth)
|
|
implementation(libs.coroutines.test)
|
|
implementation(libs.android.test.runner)
|
|
implementation(libs.android.test.ext.junit)
|
|
}
|
|
}
|
|
}
|