-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Implement MSC3440 relation filtering #11086
Comments
Not identical, but #6301 does some similar things to what we would need. A major difference for this, compared to the other ways a message is currently filtered, is that this depends on other events, not the current event. This would require additional data to be pulled from the database (I think), which is rather unfortunate and has annoying refactoring effects (mainly that a variety of methods need to be made async to deal with this). |
The problem I'm running into right now is that this filtering is not done on the event itself, but events that reference this event. This is something new and it isn't clear how to tackle it. We also do filtering in two places:
I think I see two approaches of how we can handle this: Approach 1
This is somewhat undesirable as it turns Approach 2
This is somewhat undesirable since we'll sometimes pull data that is unused, it could also be a little finicky with caches (depending on details). It keeps Would appreciate if I've missed anything with the above or if there are other ideas that people have! |
Disclaimer: I'm not super knowledgeable on the filtering code (I touched it a bit at some point but that was probably over a year ago), so I wouldn't be the best person to know of alternative approaches or gotchas. I would say approach 1 sounds better to me because it minimises the amount of data we need to pull from the db, so we should in theory be saving on db time and cache sizes. Though it's a bit of a pain if we need to do it event by event rather than being able to do it in bulk - but it sounds like it could still be manageable? On the other hand I'm wondering if, since Maybe there's an in-between solution, something like fetching a limited amount of data about relations (e.g. just the event IDs) from the database when we're retrieving events, and then, outside of |
FTR the way filtering works is that I prefer approach 1, I think if we're adding filter clauses that reference things external to the event it makes sense that the One other thing we could potentially do (riffing off Patrick's and Brendan's ideas) is to make |
Thanks both! I think your idea make sense! I'm unsure if we'll be able to pull out additional data in |
MSC3440 suggests implementing filtering on relations, specifically filtering for parent events which have:
relation_types
: Another event referring to them of particular relation type(s).relation_senders
: Another event referring to them from particular sender(s).In order to support this we'll need to:
These will have an unstable values of
io.element.relation_types
andio.element.relation_senders
as filter keys.The text was updated successfully, but these errors were encountered: