mirror of
https://github.com/strukturag/nextcloud-spreed-signaling
synced 2026-03-14 14:35:44 +01:00
Fix storing initial data when clustered.
This commit is contained in:
parent
ba1af553e0
commit
9e98b7bf13
2 changed files with 27 additions and 4 deletions
|
|
@ -380,6 +380,7 @@ func (t *TransientData) SetInitial(data TransientDataEntries) {
|
|||
}
|
||||
|
||||
msgData[k] = v.Value
|
||||
t.data[k] = v
|
||||
}
|
||||
if len(msgData) == 0 {
|
||||
return
|
||||
|
|
|
|||
|
|
@ -275,12 +275,34 @@ func Test_TransientMessages(t *testing.T) {
|
|||
require.LessOrEqual(len(ignored), 1, "Received too many messages: %+v", ignored)
|
||||
}
|
||||
|
||||
checkMessageTransientInitial(t, msg, api.StringMap{
|
||||
"abc": data,
|
||||
})
|
||||
|
||||
client4, hello4 := NewTestClientWithHello(ctx, t, server1, hub1, testDefaultUserId+"4")
|
||||
roomMsg = MustSucceed2(t, client4.JoinRoom, ctx, roomId)
|
||||
require.Equal(roomId, roomMsg.Room.RoomId)
|
||||
|
||||
client2.RunUntilJoined(ctx, hello4.Hello)
|
||||
client3.RunUntilJoined(ctx, hello4.Hello)
|
||||
|
||||
_, ignored, ok = client4.RunUntilJoinedAndReturn(ctx, hello2.Hello, hello3.Hello, hello4.Hello)
|
||||
require.True(ok)
|
||||
|
||||
if len(ignored) == 0 {
|
||||
msg = MustSucceed1(t, client4.RunUntilMessage, ctx)
|
||||
} else if len(ignored) == 1 {
|
||||
msg = ignored[0]
|
||||
} else {
|
||||
require.LessOrEqual(len(ignored), 1, "Received too many messages: %+v", ignored)
|
||||
}
|
||||
|
||||
checkMessageTransientInitial(t, msg, api.StringMap{
|
||||
"abc": data,
|
||||
})
|
||||
|
||||
delta := time.Until(setAt.Add(ttl))
|
||||
if assert.Greater(delta, time.Duration(0), "test runner too slow?") {
|
||||
checkMessageTransientInitial(t, msg, api.StringMap{
|
||||
"abc": data,
|
||||
})
|
||||
|
||||
time.Sleep(delta)
|
||||
if msg, ok = client2.RunUntilMessage(ctx); ok {
|
||||
checkMessageTransientRemove(t, msg, "abc", data)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue