From f033a141a16a2b642b27e3153eef9be83fbe20bf Mon Sep 17 00:00:00 2001 From: David Robertson Date: Tue, 18 Oct 2022 15:09:21 +0100 Subject: [PATCH] Allow HSes to omit device display names Hopefully gets https://github.com/matrix-org/synapse/pull/10015 over the line. --- tests/41end-to-end-keys/06-device-lists.pl | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/41end-to-end-keys/06-device-lists.pl b/tests/41end-to-end-keys/06-device-lists.pl index 50570dc24..600aaf8b3 100644 --- a/tests/41end-to-end-keys/06-device-lists.pl +++ b/tests/41end-to-end-keys/06-device-lists.pl @@ -208,9 +208,12 @@ sub sync_until_user_in_device_list_id my $alice_device_keys = $alice_keys->{ $user2->device_id }; # TODO: Check that the content matches what we uploaded. - - assert_eq( $alice_device_keys->{"unsigned"}->{"device_display_name"}, - "test display name" ); + # Device display names aren't mandated in the POST /user/keys/query response, + # and they're considered optional in the GET /user/devices/{userId} response. + # So accept either a match or a lack of key. + my $device_display_name = $alice_device_keys->{"unsigned"}->{"device_display_name"}; + $device_display_name = undef or $device_display_name = "test display name" or + croak "Unexpected device_display_name: $device_display_name"; Future->done(1) });