Element has a customer who has the following use-case: they'd like to be able to prove whether a given event was transmitted to a given remote homeserver. Whether it was pushed via /send or pulled by the remote using either /backfill, /get_missing_events or /event.
They would like to have a module which can listen for moment and notify an external service that the transmission has occurred. The relevant metadata is:
- Event ID
- Room ID
- potentially
sender
- Destination homeserver
I'd personally add "method of delivery" to that list.
To facilitate this, I envision a new Synapse module API named on_event_delivered_over_federation (or perhaps on_event_federated?) with the following signature:
async def on_event_delivered_over_federation(event: EventBase, destination_server_name: str, method: FederatedEventDeliveryMethod /* enum */) -> None
The module could retrieve the room_id and sender from the event if desired.
Ideally this would work across workers, but technically it doesn't need to. One could install this module on all workers, and then despite the federation sender that sent out the event, or the federation reader which received a relevant request, an attached module could report it. The reports could then be de-duplicated on the external service side.
Element has a customer who has the following use-case: they'd like to be able to prove whether a given event was transmitted to a given remote homeserver. Whether it was pushed via
/sendor pulled by the remote using either/backfill,/get_missing_eventsor/event.They would like to have a module which can listen for moment and notify an external service that the transmission has occurred. The relevant metadata is:
senderI'd personally add "method of delivery" to that list.
To facilitate this, I envision a new Synapse module API named
on_event_delivered_over_federation(or perhapson_event_federated?) with the following signature:The module could retrieve the
room_idandsenderfrom theeventif desired.Ideally this would work across workers, but technically it doesn't need to. One could install this module on all workers, and then despite the federation sender that sent out the event, or the federation reader which received a relevant request, an attached module could report it. The reports could then be de-duplicated on the external service side.