element-hq / element-hq/synapse
Federation /event returns 404 for state and auth events if history visibility is high
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 600
- Avg merge
- 5d 22h
- Merged PRs (30d)
- 51
Description
This issue has been migrated from [#9600](https://github.com/matrix-org/synapse/issues/9600).
---
If a server gets an event with an auth event it doesn't have, or requests `/state_ids` which returns events it doesn't have, the server will try and request those events from other servers via `/event`.
If the history visibility at the event is `joined` and the requesting server wasn't in the room at the time, then requests for that event will fail the auth checks and return a 404:
https://github.com/matrix-org/synapse/blob/2a99cc6524808380d2353ffff013cfa6fdfc09db/synapse/handlers/federation.py#L1877-L1888
We shouldn't be 404ing requests for auth events or state.
Contributor guide
Research direction
Start in synapse/handlers/federation.py at the linked lines 1877-1888 and trace how /event requests are checked when history visibility is joined. Verify the behavior for missing auth and state events; done means those requests are not rejected with 404 solely because the requesting server was not in the room at that time.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100