Skip to content

Synapse modules lack a way to know whether a given event has been sent to a remote homeserver #19904

Description

@anoadragon453

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions