Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow HSes to omit device display names #1307

Merged
merged 2 commits into from
Oct 18, 2022

Conversation

DMRobertson
Copy link
Contributor

Hopefully gets matrix-org/synapse#10015 over the line.

I don't speak perl and it's not easy to test this change against that PR because it comes from a fork.

I suggest we merge this if CI is green and move on with our lives.

# 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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wtf was I smoking---this = is assinging, not testing (==?)

I'm going to have to read perl docs now, aren't I?

Copy link
Contributor

@H-Shay H-Shay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My perl is as good as yours but it's green so sure?

@DMRobertson
Copy link
Contributor Author

I tried to convince myself this was sane as follows:

dmr on titan in sytest on  dmr/relax-device-display-name via 🐪 v5.34.1 
2022-10-18 21:20:16 ✔  $ cat temp.pl
#! /usr/bin/env perl
use strict;
use warnings;
my $var;

print "I think \$var is undef?\n";
if (defined $var) { print "defined\n" } else { print "undefined\n" };
if ($var eq "hello") { print "eq \"hello\"\n" } else { print "not eq \"hello\"\n"};

$var = "hello";
print "\$var is \"hello\"?\n";
if (defined $var) { print "defined\n" } else { print "undefined\n" };
if ($var eq "hello") { print "eq \"hello\"\n" } else { print "not eq \"hello\"\n"};

$var = "world";
print "\$var is \"world\"?\n";
if (defined $var) { print "defined\n" } else { print "undefined\n" };
if ($var eq "hello") { print "eq \"hello\"\n" } else { print "not eq \"hello\"\n"};


dmr on titan in sytest on  dmr/relax-device-display-name via 🐪 v5.34.1 
2022-10-18 21:20:39 ✔  $ ./temp.pl 
I think $var is undef?
undefined
Use of uninitialized value $var in string eq at ./temp.pl line 8.
not eq "hello"
$var is "hello"?
defined
eq "hello"
$var is "world"?
defined
not eq "hello"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants