Skip to content
This repository has been archived by the owner on Nov 25, 2024. It is now read-only.

Invalid username on appservice user creation due to underscore #1599

Closed
wlcx opened this issue Nov 26, 2020 · 2 comments
Closed

Invalid username on appservice user creation due to underscore #1599

wlcx opened this issue Nov 26, 2020 · 2 comments

Comments

@wlcx
Copy link

wlcx commented Nov 26, 2020

Background information

  • Dendrite version or git SHA: 0.3.1
  • Monolith or Polylith?: Monolith
  • SQLite3 or Postgres?: Postgres
  • Running in Docker?: Yes
  • go version: Docker version

Description

When running the discord app service (https://github.com/Half-Shot/matrix-appservice-discord, v0.5.2), I get errors in the appservice's log regarding username registration:

discord-appsvc_1  | Nov-25 18:31:55.757 [UserSync] info: Creating new user @_discord_567871284180942858:hacksrus.uk
discord-appsvc_1  | Nov-25 18:31:55.772 [UserSync] error: Failed to update user's profile [M_INVALID_USERNAME: Username cannot start with a '_'] {
discord-appsvc_1  |   errcode: 'M_INVALID_USERNAME',
discord-appsvc_1  |   data: {
discord-appsvc_1  |     errcode: 'M_INVALID_USERNAME',
discord-appsvc_1  |     error: "Username cannot start with a '_'"
discord-appsvc_1  |   },
discord-appsvc_1  |   httpStatus: 400
discord-appsvc_1  | }

On discussion in #dendrite{,-dev}, it seems like is because dendrite calls validateUsername rather than validateApplicationServiceUsername : https://github.com/matrix-org/dendrite/blob/master/clientapi/routing/register.go#L484-L486

Steps to reproduce

  • Run the discord appservice bridged to a discord guild
  • send a message in a channel, causing the app service to try to create a user
@wlcx
Copy link
Author

wlcx commented Nov 27, 2020

Somewhat related #630

@Half-Shot
Copy link
Contributor

Oh missed this, we're using #1784

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

No branches or pull requests

3 participants