element-hq / element-hq/synapse
Investigate whether try/catch statement is necessary when building list of target hosts for /make_* endpoints
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 600
- Avg merge
- 5d 22h
- Merged PRs (30d)
- 51
Description
This issue has been migrated from [#8808](https://github.com/matrix-org/synapse/issues/8808).
---
The `do_invite_join`, `do_remotely_reject_invite` and (if https://github.com/matrix-org/synapse/pull/6739 is merged) `do_knock` all include a similar bit of code for inserting a remote server name at the beginning of a list of target hosts. This code includes a `try`/`catch` statement for `ValueError` that seems unnecessary.
https://github.com/matrix-org/synapse/blob/7127855741faaf9544339db4faa7d25b0158fdfc/synapse/handlers/federation.py#L1360-L1367
https://github.com/matrix-org/synapse/blob/b08dc7effed4a880384e386cdca50c5d15870904/synapse/handlers/federation.py#L1655-L1662
Contributor guide
Assessment
This issue has not been assessed yet.