matrix-org / matrix-org/matrix-rust-sdk

Creating a new room that invites a non-existent matrix ID doesn't fail and instead retries (indefinitely?).

Open
#3,775 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
2.3k
Forks
500
Avg merge
1d 16h
Merged PRs (30d)
106

Description

Calling `Client::create_room` (in the FFI) with the following parameters (specifically with an invite for a matrix ID that doesn't exist), seemingly runs forever and instead of failing, keeps creating new (empty) rooms. I left it for a minute or so and have 10 rooms, so not sure if there's a limit. Also unsure if it's important that the domain doesn't exist (that's just how the UI gets triggered on Element X) or just that the user doesn't exist.

```
CreateRoomParameters = {
name = nil
topic = nil
isEncrypted = true
isDirect = true
visibility = private
preset = trustedPrivateChat
invite = 1 value {
[0] = "@someone:unregistereddomain.uk"
}
avatar = nil
powerLevelContentOverride = PowerLevels {
usersDefault = nil
eventsDefault = nil
stateDefault = nil
ban = nil
kick = nil
redact = nil
invite = nil
notifications = nil
users = 0 key/value pairs {}
events = 2 key/value pairs {
[0] = (key = "org.matrix.msc3401.call.member", value = 0)
[1] = (key = "m.call.member", value = 0)
}
}
}
```

Looking at the response from matrix.org which is a 502 mentioning Cloudflare, it's possible this is a backend configuration issue rather than an SDK issue, but it still seems unexpected that it retries so many times.

```

matrix-client.matrix.org | 502: Bad gateway





Bad gateway
Error code 502



Visit cloudflare.com for more information.

2024-07-29 13:35:06 UTC













You



Browser


Working



London



Cloudflare


Working








matrix-client.matrix.org



Host


Error






What happened?


The web server reported a bad gateway error.




What can I do?


Please try again in a few minutes.





```

Contributor guide

Open the contributing guide

Research direction

Start at the FFI entry point Client::create_room and reproduce the request with an invite for @someone:unregistereddomain.uk, observing the 502 response and repeated room creation. Trace the retry behavior and verify that an invalid invite or backend failure produces a bounded failure without creating rooms indefinitely.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
api, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.