element-hq / element-hq/dendrite

Can't join room when both local and room-creating homeservers aren't participating

Open
#2,388 0 comments 0 reactions 0 assignees View on GitHub
C-Roomserver T-Defect
Dominant language
Go
Stars
965
Forks
101
PR merge metrics
No merged PRs in 30d

Description

*This issue was originally created by [**@bones-was-here**](https://github.com/bones-was-here) at .*

### Background information

- **Dendrite version or git SHA**: 54ff4cf690918886c7e7a59a65ccff970c3aa1fc
- **Monolith or Polylith?**: monolith
- **SQLite3 or Postgres?**: postgres
- **Running in Docker?**: no
- **`go version`**: 1.17.9
- **Client used (if applicable)**: element web

### Description

- **What** is the problem: If the local homeserver currently has no users in the room, and the homeserver that created the room (owns the namespace of the room ID and canonical alias) also has no users in the room, joining fails with "no remaining users on this server".
- **Who** is affected: Anyone trying to join a room under such conditions
- **How** is this bug manifesting: joining fails with "no remaining users on this server"
- **When** did this first appear: may have always been like this?

### Steps to reproduce

- Try to join a room under the above circumstances

In my case I created rooms using a dendrite homeserver that existed only to control a namespace (not to host end users)
Then invited some users on other homeservers, and had the user that created the room, leave (and that user was the only user on that homeserver)

Workarounds: either of:
- Use an account on a homeserver that is currently participating in the room to invite the user that wants to join
- Join using `curl` with the `/_matrix/client/v3/join/{roomIdOrAlias}` endpoint and specify `?server_name=matrix.org` where "matrix.org" == some homeserver known to be currently participating in the room

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure by joining a room where neither the local homeserver nor the room-creating homeserver has participating users, using Element Web and the /_matrix/client/v3/join/{roomIdOrAlias} endpoint. Compare the normal join with the documented server_name workaround; done means the normal join succeeds under those conditions without requiring a participating homeserver to be specified.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, postgresql
Domain
backend, distributed-systems, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.