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

we seem to be returning the wrong error code when adding an undefined alias to canonical_alias #7105

Closed
richvdh opened this issue Mar 19, 2020 · 3 comments
Assignees

Comments

@richvdh
Copy link
Member

richvdh commented Mar 19, 2020

we're returning a 404 with {errcode: "M_NOT_FOUND", error: "Room alias #megolm:sw1v.org not found"}; matrix-org/matrix-spec-proposals#2432 (comment) suggests a different conclusion.

The upshot is that the error message in riot is unhelpful:
Peek 2020-03-19 09-38

@richvdh
Copy link
Member Author

richvdh commented Mar 19, 2020

related to #6898

@clokep
Copy link
Member

clokep commented Mar 19, 2020

@richvdh I believe this is working as expected. The validation code throw three errors:

  1. M_INVALID_PARAM if the form of the alias is wrong.
  2. M_NOT_FOUND if the alias is completely unknown.
  3. M_BAD_ALIAS if the alias is found, but does not point to this room.

I think this matches the comment you pointed to, when taking into account the context of the conversation above it.

Note that the logic for this was implemented in #6971, although it is a bit hard to see:

  1. M_INVALID_PARAM is raised from RoomAlias.from_string()
  2. M_NOT_FOUND is raised via directory_handler.get_association()
  3. M_BAD_ALIAS is raised directly.

@clokep
Copy link
Member

clokep commented Mar 26, 2020

This was fixed in #7109.

@clokep clokep closed this as completed Mar 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants