Fix skipping subsequent call links.

This commit is contained in:
Alex Hart
2025-05-21 14:57:42 -03:00
committed by Cody Henthorne
parent 23669c3c37
commit 8e92ddbd53
2 changed files with 22 additions and 1 deletions

View File

@@ -98,7 +98,8 @@ class CallEventCache(
val child = next()
if (child.type == Type.AD_HOC_CALL.code) {
continue
previous()
break
}
if (parent.peer == child.peer && parent.direction == child.direction && isEventMatch(parent, child) && isWithinTimeout(parent, child)) {

View File

@@ -172,6 +172,26 @@ class CallEventCacheTest {
assertThat(result).size().isEqualTo(3)
}
@Test
fun `Given two call link entries in a row, when I clusterCallEvents, then I expect two entries`() {
val testData = listOf(
createCacheRecord(
callId = 1,
peer = 1,
type = Type.AD_HOC_CALL.code
),
createCacheRecord(
callId = 2,
peer = 2,
type = Type.AD_HOC_CALL.code
)
)
val filterState = CallEventCache.FilterState()
val result = CallEventCache.clusterCallEvents(testData, filterState)
assertThat(result).size().isEqualTo(2)
}
private fun createCacheRecord(
callId: Long,
peer: Long = 1,