element-hq / element-hq/synapse
Admin API for requesting events for a room that are waiting to be processed after inbound federation (ie events in `federation_inbound_events_staging`)
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 600
- Avg merge
- 5d 22h
- Merged PRs (30d)
- 51
Description
This issue has been migrated from [#12086](https://github.com/matrix-org/synapse/issues/12086).
---
**Description:**
We would like an admin api to view events that are waiting in `federation_inbound_events_staging` for a specific room.
The reason being we want this is so that during a heavy spam attack we can have better viability about what is happening in a room by cutting out some of the latency where we would have to wait for Synapse to process inbound events. Though, I understand that this will not give us a complete picture and the events can be rejected.
What I am imagining is something like this:
#### Check for inbound events
`GET /_synapse/admin/v1/rooms//federation_inbound_events`
The response that will be returned
```
{
"events": [
{
"content": {
"body": "This is an example text message",
"msgtype": "m.text",
"format": "org.matrix.custom.html",
"formatted_body": "This is an example text message"
},
"type": "m.room.message",
"event_id": "$143273582443PhrSn:example.org",
"room_id": "!636q39766251:example.com",
"sender": "@example:example.org",
"origin_server_ts": 1432735824653,
"unsigned": {
"age": 1234
}
}
]
}
```
Things I am assuming in the above
1. The events will be relatively recent and will not have been through authorization before. (If this isn't true, then at the least there probably needs to be some information about what the previous events were for each event).
2. The events will be returned in chronological order
3. That there will not be enough events in the response to warrant mimicking https://spec.matrix.org/v1.2/client-server-api/#get_matrixclientv3roomsroomidmessages but that's not a problem for me if there could be.
4. That there will be no penalty for repeatedly calling this endpoint for updates
5. That the sender matches the origin of the event
Contributor guide
Assessment
This issue has not been assessed yet.