Case sensitivity of usernames?
Headline
Are usernames supposed to be downcased in certain APIs?
Description
With https://github.com/matrix-org/matrix-appservice-slack I was seeing some errors about usernames already registered. I think it may have to do with case sensitivity of usernames - as when I made this change I no longer would see the errors:
diff --git a/src/SlackGhostStore.ts b/src/SlackGhostStore.ts
index 91ed109..f5dd95f 100644
--- a/src/SlackGhostStore.ts
+++ b/src/SlackGhostStore.ts
@@ -55,7 +55,7 @@ export class SlackGhostStore {
}
public getUserId(id: string, teamDomain: string): string {
- const localpart = `${this.config.username_prefix}${teamDomain.toLowerCase()}_${id.toUpperCase()}`;
+ const localpart = `${this.config.username_prefix}${teamDomain.toLowerCase()}_${id.toLowerCase()}`;
return `@${localpart}:${this.config.homeserver.server_name}`;
}
I do see the things about "POST /register downcases capitals in usernames" in https://gitlab.com/famedly/conduit/-/blob/next/tests/sytest/are-we-synapse-yet.py - so maybe Conduit is acting correctly? Are there some APIs where usernames are still supposed to be normalized to lowercase on the server side? Or is matrix-appservice-slack acting incorrectly in using usernames with capitalization?