element-hq / element-hq/synapse

`FederationDeniedError` is not a `SynapseError`

Open
#14,190 0 comments 0 reactions 0 assignees View on GitHub
T-Task
Dominant language
Python
Stars
4.6k
Forks
600
Avg merge
5d 22h
Merged PRs (30d)
51

Description

This issue has been migrated from [#14190](https://github.com/matrix-org/synapse/pull/14190).

---

`FederationDeniedError` is not a `SynapseError`.

Basically the same reasoning that @erikjohnston gave in https://github.com/matrix-org/synapse/pull/13816#discussion_r993262622

> I'm not sure it makes sense for this to inherit from `SynapseError`. The risk is that this manages to bubble all the way to the client API, returning a 403, which seems entirely wrong.

See https://github.com/matrix-org/synapse/pull/14191 where `SynapseError` is given more context and clarified.

### Todo

- [ ] Make sure any upstream callers handle `FederationDeniedError` properly and not just the inherited `SynapseError` class

### Pull Request Checklist

* [ ] Pull request is based on the develop branch
* [ ] Pull request includes a [changelog file](https://matrix-org.github.io/synapse/latest/development/contributing_guide.html#changelog). The entry should:
- Be a short description of your change which makes sense to users. "Fixed a bug that prevented receiving messages from other servers." instead of "Moved X method from `EventStore` to `EventWorkerStore`.".
- Use markdown where necessary, mostly for `code blocks`.
- End with either a period (.) or an exclamation mark (!).
- Start with a capital letter.
- Feel free to credit yourself, by adding a sentence "Contributed by @github_username." or "Contributed by [Your Name]." to the end of the entry.
* [ ] Pull request includes a [sign off](https://matrix-org.github.io/synapse/latest/development/contributing_guide.html#sign-off)
* [ ] [Code style](https://matrix-org.github.io/synapse/latest/code_style.html) is correct
(run the [linters](https://matrix-org.github.io/synapse/latest/development/contributing_guide.html#run-the-linters))

Contributor guide

Open the contributing guide

Research direction

Start by tracing upstream callers of FederationDeniedError and compare their handling with SynapseError. Check that the exception cannot incorrectly bubble to the client API as a 403, and verify that each caller handles FederationDeniedError explicitly. Run the relevant tests after updating the callers.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.