matrix-org / matrix-org/matrix-spec

Autodiscovery process is underspecified, does not mention direct hostname connections

Open
#534 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-Client-Server feature
Dominant language
HTML
Stars
330
Forks
150
Avg merge
2h 21m
Merged PRs (30d)
3

Description

The [Server Discovery section in the Client-Server specification](https://matrix.org/docs/spec/client_server/r0.5.0#server-discovery) states that clients...

> SHOULD use an auto-discovery mechanism to determine the server's URL based on a user's Matrix ID.

However, there are two underspecified things in the section:

1. Does this also apply when the username and the HS hostname are entered by the user separately? For the sake of consistent behaviour, I'd argue that it probably should, but the specification *currently* scopes it to hostname extraction from Matrix IDs only.
2. Where does a 'direct attempt' fit into the picture? For example, Feneas [does not have](https://feneas.org/.well-known/matrix/client/) a `.well-known` for Matrix, and clients are presumably able to still connect to Feneas because they literally attempt the specified `feneas.org` hostname, bypassing the `.well-known` process entirely.

The problem with the second point is particularly that it isn't clear how a 'direct attempt' relates to a `.well-known`-based attempt, ordering-wise; presumably clients *are* doing direct attempts out-of-spec, or Feneas would've already had complaints about their missing `.well-known`.

But are those clients doing that *before* or *after* the `.well-known` attempt? For example, a situation could exist where a Matrix server A on `example-a.com` has a `.well-known` that points at a Matrix server B on `example-b.com`, in which case different clients attempting to log into `example-a.com` would connect to different Matrix servers (A or B) depending on whether they try the literal hostname or the `.well-known` first.

Therefore, personally, I think that "literal hostname attempt" should be added to the list of autodiscovery methods in a well-defined position (relative to `.well-known`), and that it should apply consistently regardless of whether the 'base hostname' was extracted from a Matrix ID or specified explicitly.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Server Discovery section in the Client-Server specification linked in the issue. Clarify whether autodiscovery applies to separately entered usernames and hostnames, and define the ordering of literal hostname and .well-known attempts; done means the specification states these rules unambiguously.

Written by the indexing model from the issue text.

Assessment

Domain
documentation
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.