Skip to content

Commit

Permalink
Fix view event replay
Browse files Browse the repository at this point in the history
  • Loading branch information
bmarty committed Jan 10, 2023
1 parent cceb1cd commit 9b421e2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion vector/src/main/java/im/vector/app/core/utils/SharedEvent.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package im.vector.app.core.utils
import im.vector.app.core.platform.VectorViewEvents
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.MutableSharedFlow
import kotlinx.coroutines.flow.onEach
import kotlinx.coroutines.flow.transform
import java.util.concurrent.CopyOnWriteArraySet

Expand All @@ -34,7 +35,9 @@ class EventQueue<T : VectorViewEvents>(capacity: Int) : SharedEvents<T> {
innerQueue.tryEmit(OneTimeEvent(event))
}

override fun stream(consumerId: String): Flow<T> = innerQueue.filterNotHandledBy(consumerId)
override fun stream(consumerId: String): Flow<T> = innerQueue
.onEach { innerQueue.resetReplayCache() }
.filterNotHandledBy(consumerId)
}

/**
Expand Down

0 comments on commit 9b421e2

Please sign in to comment.