diff --git a/protocol/messenger_test.go b/protocol/messenger_test.go index c37ce6278..17703ff31 100644 --- a/protocol/messenger_test.go +++ b/protocol/messenger_test.go @@ -91,7 +91,7 @@ func (n *testNode) GetWhisper(_ interface{}) (types.Whisper, error) { return nil, nil } -func (c *testNode) PeersCount() int { +func (n *testNode) PeersCount() int { return 1 } diff --git a/protocol/pushnotificationclient/client.go b/protocol/pushnotificationclient/client.go index 16f0c3c03..3bae76e44 100644 --- a/protocol/pushnotificationclient/client.go +++ b/protocol/pushnotificationclient/client.go @@ -319,6 +319,7 @@ func (c *Client) pickDefaultServers(servers []*ecdsa.PublicKey) []*ecdsa.PublicK // shuffle and pick n at random shuffledServers := make([]*ecdsa.PublicKey, len(servers)) copy(shuffledServers, c.config.DefaultServers) + mrand.Seed(time.Now().Unix()) mrand.Shuffle(len(shuffledServers), func(i, j int) { shuffledServers[i], shuffledServers[j] = shuffledServers[j], shuffledServers[i] }) @@ -1151,6 +1152,7 @@ func (c *Client) sendNotification(publicKey *ecdsa.PublicKey, installationIDs [] // NOTE: here's is a tradeoff, ideally we want to randomly pick a server, // but hit the same servers for batched notifications, for now naively // hit a random server + mrand.Seed(time.Now().Unix()) mrand.Shuffle(len(info), func(i, j int) { info[i], info[j] = info[j], info[i] }) diff --git a/services/ext/node_mock.go b/services/ext/node_mock.go index ad948b779..a96a108cc 100644 --- a/services/ext/node_mock.go +++ b/services/ext/node_mock.go @@ -28,6 +28,10 @@ func (w *TestNodeWrapper) GetWaku(_ interface{}) (types.Waku, error) { return w.waku, nil } +func (w *TestNodeWrapper) PeersCount() int { + return 1 +} + func (w *TestNodeWrapper) AddPeer(url string) error { panic("not implemented") }