You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently when an incoming federation event is "bad" for some reason it is rejected by returning a 400 error. This is particularly troublesome in endpoints where multiple events are handled at once, as the entire transaction gets rejected.
Reasons an event might be rejected include:
events with no type or depth
events with bad depth values
events in v{1,2} rooms with no event_id/v3+ rooms with an event_id
events in v6 rooms that have integers out of range or floats
There are three proposed options for this situation:
silently drop the event. I would argue that we should not be blackholing events, ever: it feels like we'll end up dropping events unexpectedly.
send an error back in the response, against the event's event_id. This, of course, requires the recipient to parse the json, remove a couple of properties, then re-encode it using canonicaljson (which, you recall, is theoretically impossible) to calculate the event id. That sounds like a tautology to me. It also requires servers which don't even support older room versions to still accept transactions with floats in them. So that leaves us with:
reject the whole lot.
It is potentially difficult to return a sensible error since (theoretically) you might not even be able to parse the event data and thus it is proposed to silently drop these events for now.
The text was updated successfully, but these errors were encountered:
Currently when an incoming federation event is "bad" for some reason it is rejected by returning a 400 error.
It's worth emphasising that this is only correct for events that cannot be parsed as an EventBase. There are plenty of other things that can make an event "bad" which do not cause a 400 error; instead the event is put onto the queue for asynchronous processing, and dropped if deemed "invalid".
This issue has been migrated from #7543.
This is based on a conversation at matrix-org/matrix-spec-proposals#2540 (comment), summarized below:
Currently when an incoming federation event is "bad" for some reason it is rejected by returning a 400 error. This is particularly troublesome in endpoints where multiple events are handled at once, as the entire transaction gets rejected.
Reasons an event might be rejected include:
type
ordepth
depth
valuesevent_id
There are three proposed options for this situation:
It is potentially difficult to return a sensible error since (theoretically) you might not even be able to parse the event data and thus it is proposed to silently drop these events for now.
The text was updated successfully, but these errors were encountered: