Clear stale unanswered calls before new invite
This commit is contained in:
@@ -530,6 +530,28 @@ func TestHandleBroadcastCallRequiresStructuredInvite(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestVideoCallStaleUnanswered(t *testing.T) {
|
||||
now := time.Date(2026, time.September, 4, 10, 5, 0, 0, time.UTC)
|
||||
call := &videoCall{
|
||||
parties: map[string]callPartyData{"origin": {isOriginator: true}},
|
||||
startedAt: now.Add(-31 * time.Second),
|
||||
}
|
||||
if !call.isStaleUnanswered(now, 30) {
|
||||
t.Fatal("unanswered call older than establishment timeout should be stale")
|
||||
}
|
||||
|
||||
call.startedAt = now.Add(-29 * time.Second)
|
||||
if call.isStaleUnanswered(now, 30) {
|
||||
t.Fatal("unanswered call within establishment timeout should not be stale")
|
||||
}
|
||||
|
||||
call.parties["callee"] = callPartyData{}
|
||||
call.startedAt = now.Add(-31 * time.Second)
|
||||
if call.isStaleUnanswered(now, 30) {
|
||||
t.Fatal("accepted call must not be treated as stale by establishment timeout")
|
||||
}
|
||||
}
|
||||
|
||||
func TestHandleBroadcastDataGroup(t *testing.T) {
|
||||
topicName := "grp-test"
|
||||
numUsers := 4
|
||||
|
||||
Reference in New Issue
Block a user