File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
kotlin-sdk/src/commonMain/kotlin/dev/openfeature/kotlin/sdk/multiprovider Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,8 @@ import kotlinx.coroutines.coroutineScope
1414import kotlinx.coroutines.flow.Flow
1515import kotlinx.coroutines.flow.MutableSharedFlow
1616import kotlinx.coroutines.flow.asSharedFlow
17+ import kotlinx.coroutines.flow.first
18+ import kotlinx.coroutines.flow.firstOrNull
1719import kotlinx.coroutines.flow.launchIn
1820import kotlinx.coroutines.flow.onEach
1921
@@ -119,7 +121,7 @@ class MultiProvider(
119121
120122 // If the status has been updated, calculate what our new event should be
121123 if (hasStatusUpdated) {
122- val currPrecedenceVal = eventFlow.replayCache.firstOrNull()? .run { eventPrecedence[this ::class ] } ? : 0
124+ val currPrecedenceVal = eventFlow.first() .run { eventPrecedence[this ::class ] } ? : 0
123125 val updatedPrecedenceVal = eventPrecedence[event::class ] ? : 0
124126
125127 if (updatedPrecedenceVal > currPrecedenceVal) {
You can’t perform that action at this time.
0 commit comments