-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Conversation
Can one of the admins verify this patch? |
4 similar comments
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
* API now returns aggregation_data * removed unused code * Note that aggregation_entries is now one per (event_type, target_id) rather than one per (target_id) - so they are manually merged server-side to yield a single aggregation_data blob on the event. * TODO: make aggregation code less invasive on Synapse structure
I'm quite excited for a feature like this, as it also fits my needs for counting various properties of messages. However, could you make this into a google doc or something as a spec doc. It feels too cramped to be stuck on a PR. Especially since this is a spec change and really needs to be reviewed in matrix-doc first. |
Very excited for this as well. Also referencing in the riot issue for editable messages: |
(just wanted to confirm that properly digesting this is on our radar - @pik: thanks for the significant work here!) |
Some other example usages of this when bridges are involved are below. Please correct me if these would be inappropriate usages of the aggregations api... I'm trying to understand the different ways they can be used: With bridges, when a real matrix user sends a message into a bridged room, it would be nice to be able to specify to the user if a specific message failed to be delivered to the bridged network with a red X icon next to the message in the client. Another example -- We have an iMessage bridge. When an outside iMessage user sends a message and it passes to me through the matrix bridge, it would be nice to know whether the sender had used SMS or iMessage to send the message. |
hi @pik - this continues to be on our radar. I think the best way to proceed is going to be to work on the proposal change to the spec first, and then evolve the implementation as required. The workflow for this is to write a google doc proposal as per the ones hiding in https://drive.google.com/drive/u/0/folders/0B4wHq8qP86r2ck15MHEwMmlNVUk, and then we'll be able to review it properly there. We use google rather than github for this as the review semantics (both commenting and 'suggesting') are quite a lot richer. |
@pik: i've finally had a chance to properly read through this (the requirement for being able to retrospectively attach metadata to events is getting ever more urgent, especially for being able to upvote/downvote messages for moderation purposes). Initial thoughts are:
The approach of using separate tables to track the aggregations feels right overall however, and this is definitely a step in the right direction. I'd be happy to help try to steer this through with you to get it merged! |
Apologies for the delay on the spec part. Here is a link to a preliminary Google Doc: https://docs.google.com/document/d/1CnNbYSSea0KcyhEI6-rB8R8u6DCZyZv-Pv4hhoXJHSE/edit?usp=sharing Since a lot of choices made in this PR (implementation wise) depend on some specification choices I didn't go into exact detail of implementation pending agreement on the Spec more generally (they can be fleshed out later).
If Slack style emoji's are desired e.g. Matthew, Pik reacted with 🎆 -- than I guess append would be the only way to do it, depending on the application they might not care for those details though, in which case client-side aggregation or support for more conditional operators (I added the discussion to the google doc under Conditional Logic & Aggregation Logic).
Let's pick these up in Google Doc discussion/comments? |
Just curious if there's been any forward progress on this? |
Just curious if there's been any progress or updates with this? |
For the record: complicated things like aggregations are currently shelved in favour of getting stability on the features we have, rather than adding new ones. [Sadly I gather pik is no longer with us. I very much hope that one day we can pick this up again and give his work the attention it deserved.] |
we now have aggregations via #5186, which took some inspiration from @pik's work here (as per the notes in https://github.com/matrix-org/matrix-doc/blob/matthew/msc1849/proposals/1849-aggregations.md), so i'm going to close this. pik: thanks again for setting the ball rolling on this, and I'm really sorry that we didn't get to work on this sooner, and that you're not here to see the conclusion :( |
Matrix is currently missing an implementation/spec for processing Aggregation type events.
This includes some functionality necessary and expected by users from a chat client, such as being able to edit a message or add a reaction a to a message sent by another user.
While it's possible to implement said functionality as direct and hard-coded endpoints, this would have a number of drawbacks:
This is a stab at an open-ended aggregation approach:
Currently the following is functional:
aggregation_spec
to/room/(?P<room_id>[^/]+)/aggregation$
'm.room._aggregation'
in the background and fill in information for thetarget_id
in theaggregation_entries
table.append
andreplace
type operations are supported e.g. emoticon support to a room could be added bythe room creator POSTing the following:
This in turn would cause Synapse to run background_updates which will process
'm.room._aggregation.emoticon'
type events and append them to an array in theaggregate_entries
table e.g.:target_id
e.g.TODO
Clean Synapse API Implementation
There are a number of approaches to returning 'aggregated' events depending on whether they are pruned from the
events
table or not in the database. While the client when receiving a set of bulk events for atarget_id
will always have alatest_event_id
used in the aggregation and would know to ignore events prior to this, it would be preferable to not send those events at all to the client after they have been aggregated. This should mean either filtering the retrieved event array (e.g comparing to a cache of already known aggregated values) or pruning the aggregated events from the events table in the db entirely.Emoticon / Edit support in vector-web (riot) client.
This is a little bit complicated because the client should support both receiving bulked (aggregated entries) and singular events (for singular events it should imitate the server aggregation strategy).