the-draupnir-project / Draupnir

A Matrix moderation bot
https://the-draupnir-project.github.io/draupnir-documentation/
82 stars 14 forks source link

Cant join rooms server isn't already present within via aliases #460

Open TheArcaneBrony opened 3 months ago

TheArcaneBrony commented 3 months ago

image Draupnir 2.0.0-beta.4

Gnuxie commented 3 months ago

This issue is caused by a bunch of shortfalls in the handling of room aliases

https://github.com/Gnuxie/matrix-protection-suite/blob/main/src/MatrixTypes/MatrixRoomReference.ts#L63 needs editing so that the server name is taken from the end at a minimum

https://github.com/Gnuxie/matrix-protection-suite-for-matrix-bot-sdk/blob/main/src/Client/BotSDKBaseClient.ts#L130-L155 needs changing to take the servers from the response https://spec.matrix.org/v1.10/client-server-api/#get_matrixclientv3directoryroomroomalias. I don't think the matrix-bot-sdk gives access to them but we can fix that.

https://github.com/Gnuxie/matrix-protection-suite-for-matrix-bot-sdk/blob/main/src/Client/BotSDKBaseClient.ts#L157-L178 Could be changed to call /join directly on aliases.

Gnuxie commented 3 months ago

Changed likelihood because it's unusual to deploy draupnir on a different server to one you are using or have no users using.

FSG-Cat commented 3 months ago

Makes complete sense that those specific criteria change likelihood of running into it. I was assuming all alias resolution was going to not work when assigning labels.

FSG-Cat commented 2 months ago

Another example of this bug spotted in the wild in https://matrix.to/#/!IaWNErZAgQUhGqJXjX:matrix.org/$jM_Oa-YPWXDSGeQfz6UsCCevpndbWU6BT4cBF0ppy1U?via=matrix.org&via=envs.net&via=ubuntu.com conversation in the matrix room.

So clearly this bug has been run into by 2 users now who have reported it to us.