From c06e64b49adf948152da269242e6c6377dda3946 Mon Sep 17 00:00:00 2001 From: David Robertson Date: Tue, 18 Oct 2022 21:21:43 +0100 Subject: [PATCH] Allow HSes to omit device display names (#1307) * Allow HSes to omit device display names Hopefully gets https://github.com/matrix-org/synapse/pull/10015 over the line. * Fix perl syntax?!?! --- 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..559f6826f 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"}; + (!defined $device_display_name) or ($device_display_name == "test display name") or + croak "Unexpected device_display_name: $device_display_name"; Future->done(1) });