Skip to content

rename 'username' to 'userid' for clarity - avoids a pitfall

Asbjørn Olling requested to merge userid into main

Currently, the userid is set using an environment variable called HC_USERNAME.

At first I set this to the localpart of my user id (because this is what I'm used to being referred to as a "username"). It logs in just fine, and everything seems good at first.

But since it checks for new events, which aren't sent by username, it will never report a failure if the username is supplied just as the localpart, and not as a full matrix user id.

(Because 'alice' != '@alice:example.com' so the recently sent event is interpreted as a correct response from the pinged target).

This MR renames all instances of username to userid for clarity, and adds an assertion which does a crude check for the format.

Merge request reports