mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-22 06:38:05 +01:00
Require that message bundles include all linked devices
This commit is contained in:
committed by
Jon Chambers
parent
cb5cd64c05
commit
90e622b307
@@ -123,18 +123,21 @@ class DestinationDeviceValidatorTest {
|
||||
final byte id1 = 1;
|
||||
final byte id2 = 2;
|
||||
final byte id3 = 3;
|
||||
|
||||
final Account account = mockAccountWithDeviceAndEnabled(Map.of(id1, true, id2, false, id3, true));
|
||||
|
||||
return Stream.of(
|
||||
// Device IDs provided for all enabled devices
|
||||
arguments(
|
||||
mockAccountWithDeviceAndEnabled(Map.of(id1, true, id2, false, id3, true)),
|
||||
account,
|
||||
Set.of(id1, id3),
|
||||
null,
|
||||
Set.of(id2),
|
||||
null,
|
||||
Collections.emptySet()),
|
||||
|
||||
// Device ID provided for disabled device
|
||||
arguments(
|
||||
mockAccountWithDeviceAndEnabled(Map.of(id1, true, id2, false, id3, true)),
|
||||
account,
|
||||
Set.of(id1, id2, id3),
|
||||
null,
|
||||
null,
|
||||
@@ -142,15 +145,15 @@ class DestinationDeviceValidatorTest {
|
||||
|
||||
// Device ID omitted for enabled device
|
||||
arguments(
|
||||
mockAccountWithDeviceAndEnabled(Map.of(id1, true, id2, false, id3, true)),
|
||||
account,
|
||||
Set.of(id1),
|
||||
Set.of(id3),
|
||||
Set.of(id2, id3),
|
||||
null,
|
||||
Collections.emptySet()),
|
||||
|
||||
// Device ID included for disabled device, omitted for enabled device
|
||||
arguments(
|
||||
mockAccountWithDeviceAndEnabled(Map.of(id1, true, id2, false, id3, true)),
|
||||
account,
|
||||
Set.of(id1, id2),
|
||||
Set.of(id3),
|
||||
null,
|
||||
@@ -158,16 +161,16 @@ class DestinationDeviceValidatorTest {
|
||||
|
||||
// Device ID omitted for enabled device, included for device in excluded list
|
||||
arguments(
|
||||
mockAccountWithDeviceAndEnabled(Map.of(id1, true, id2, false, id3, true)),
|
||||
account,
|
||||
Set.of(id1),
|
||||
Set.of(id3),
|
||||
Set.of(id2, id3),
|
||||
Set.of(id1),
|
||||
Set.of(id1)
|
||||
),
|
||||
|
||||
// Device ID omitted for enabled device, included for disabled device, omitted for excluded device
|
||||
arguments(
|
||||
mockAccountWithDeviceAndEnabled(Map.of(id1, true, id2, false, id3, true)),
|
||||
account,
|
||||
Set.of(id2),
|
||||
Set.of(id3),
|
||||
null,
|
||||
@@ -176,9 +179,9 @@ class DestinationDeviceValidatorTest {
|
||||
|
||||
// Device ID included for enabled device, omitted for excluded device
|
||||
arguments(
|
||||
mockAccountWithDeviceAndEnabled(Map.of(id1, true, id2, false, id3, true)),
|
||||
account,
|
||||
Set.of(id3),
|
||||
null,
|
||||
Set.of(id2),
|
||||
null,
|
||||
Set.of(id1)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user