the-draupnir-project / planning

0 stars 0 forks source link

[Story] Timeline introspection for MPS Protection Developers #9

Open Gnuxie opened 7 months ago

Gnuxie commented 7 months ago

Description

When searching for events from a given user, Draupnir has to call /messages in every single protected room. This is a very expensive operation, and on homeservers with less resources can prevent Draupnir from redacting harmful messages when the operation takes too long. A timeline cache of visible events would allow Draupnir and protections to cheaply scan and locate events matching arbitrary criteria.

As an matrix-protection-suite protection developer, I can access a cache of the most recent events in the room timeline and scan them for harmful content or rescan them as state is changed (e.g. new policies are issued, protection config changes). Extensible Events (MSC1767) provides new ways to embed media onto any event within the room timeline. This means that there will be at least three ways to embed text content into a timeline event, and even more in the future. Therefore I need a single API to scan against all text and media embedded within an event, rather than having to manually destructure events adhoc in my protection. This will mean destructuring of events for scanning text content can be maintained in one place by the developers of the matrix-protection-suite and not repeated by protection developers improperly throughout their code. The same will need to apply for extracting images or other media from an event.

Acceptance Criteria

Issues

Dependencies

Total Pain

Will block redaction and bad phrase protection rework