element-hq / element-hq/synapse
`/join` with a "via" `server_name` query parameter pointing to a server that is down gives CORS error
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 600
- Avg merge
- 5d 22h
- Merged PRs (30d)
- 51
Description
This issue has been migrated from [#15145](https://github.com/matrix-org/synapse/issues/15145).
---
### Description
*Spawning from https://github.com/vector-im/element-web/issues/24617*
Given two links to join the same room:
```
https://matrix.to/#/!gjhRIJfdhgjd:google.com
https://matrix.to/#/!gjhRIJfdhgjd:google.com?via=feneas.org
```
Without `via`, Element Desktop 1.11.23 shows a error dialog with `404` error code (it's okay, because server does not exist more, just links exist in chats). But with `via`, the error dialog is empty and there is a `502` CORS error (unexpected)
In the case where a Matrix server where room was being hosted does not exist more, in my opinion, we should return a 404 to the user. (I expect a 404 response for the link with `via`)
### Steps to reproduce
See above.
### Homeserver
`matrix.org`
### Synapse Version
`matrix.org`
### Installation Method
I don't know
### Database
`matrix.org`
### Workers
I don't know
### Platform
`matrix.org`
### Configuration
_No response_
### Relevant log output
```shell
above
```
### Anything else that would be useful to know?
_No response_
Contributor guide
Research direction
Start at the `/join` handling path and reproduce the two matrix.to links described in the issue, including the `via` server_name parameter pointing to a down server. Compare the responses for links with and without `via`; done means the failing case returns a 404 instead of an empty dialog with a 502 CORS error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100