@@ -1999,7 +1999,7 @@ This specification describes the following relationship types:
19991999* [ Threads] ( #threading ) .
20002000* [ References] ( #reference-relations )
20012001
2002- #### Aggregations
2002+ #### Aggregations of child events
20032003
20042004{{% added-in v="1.3" %}}
20052005
@@ -2013,14 +2013,12 @@ of times that `key` was used by child events.
20132013
20142014The actual aggregation format depends on the ` rel_type ` .
20152015
2016- Aggregations are sometimes automatically included by a server alongside the parent
2017- event. This is known as a "bundled aggregation" or "bundle" for simplicity. The
2018- act of doing this is "bundling".
2019-
2020- When an event is served to the client through the APIs listed below, a ` m.relations ` property
2021- is included under ` unsigned ` if the event has child events which can be aggregated and point
2022- at it. The ` m.relations ` property is an object keyed by ` rel_type ` and value being the type-specific
2023- aggregated format for that ` rel_type ` , also known as the bundle.
2016+ When an event is served to the client through the APIs listed below, a
2017+ ` m.relations ` property is included under ` unsigned ` if the event has child
2018+ events which can be aggregated and point at it. The ` m.relations ` property is
2019+ an object keyed by ` rel_type ` and value being the type-specific aggregated
2020+ format for that ` rel_type ` . This ` m.relations ` property is known as a "bundled
2021+ aggregation".
20242022
20252023For example (unimportant fields not included):
20262024
@@ -2056,10 +2054,10 @@ For example (unimportant fields not included):
20562054}
20572055```
20582056
2059- Note how the ` org.example.possible_annotations ` bundle is an array compared to the
2060- ` org.example.possible_thread ` bundle where the server is summarising the state of
2061- the relationship in a single object. Both are valid ways to aggregate, and their
2062- exact types depend on the ` rel_type ` .
2057+ Note how the ` org.example.possible_annotations ` aggregation is an array, while in the
2058+ ` org.example.possible_thread ` aggregation where the server is summarising the state of
2059+ the relationship in a single object. Both are valid ways to aggregate: the format of an
2060+ aggregation depends on the ` rel_type ` .
20632061
20642062{{% boxes/warning %}}
20652063State events do not currently receive bundled aggregations. This is not
@@ -2086,11 +2084,11 @@ such as `/initialSync`.
20862084
20872085While this functionality allows the client to see what was known to the server at the
20882086time of handling, the client should continue to aggregate locally if it is aware of
2089- the relationship type's behaviour. For example, a client might increment a ` count `
2090- on a parent event's bundle if it saw a new child event which referenced that parent.
2087+ the relationship type's behaviour. For example, a client might internally increment a ` count `
2088+ in a parent event's aggregation data if it saw a new child event which referenced that parent.
20912089
2092- The bundle provided by the server only includes child events which were known at the
2093- time the client would receive the bundle . For example, in a single ` /sync ` response
2090+ The aggregation provided by the server only includes child events which were known at the
2091+ time the client would receive the aggregation . For example, in a single ` /sync ` response
20942092with the parent and multiple child events the child events would have already been
20952093included on the parent's ` m.relations ` field. Events received in future syncs would
20962094need to be aggregated manually by the client.
@@ -2100,7 +2098,7 @@ Events from [ignored users](#ignoring-users) do not appear in the aggregation
21002098from the server, however clients might still have events from ignored users cached. Like
21012099with normal events, clients will need to de-aggregate child events sent by ignored users to
21022100avoid them being considered in counts. Servers must additionally ensure they do not
2103- consider child events from ignored users when preparing a bundle for the client.
2101+ consider child events from ignored users when preparing an aggregation for the client.
21042102{{% /boxes/note %}}
21052103
21062104When a parent event is redacted, the child events which pointed to that parent remain, however
@@ -2109,7 +2107,7 @@ to de-aggregate or disassociate the event once the relationship is lost. Clients
21092107aggregation or which handle redactions locally should do the same.
21102108
21112109It is suggested that clients perform local echo on aggregations — for instance, aggregating
2112- a new child event into a bundle optimistically until the server returns a failure or the client
2110+ a new child event into a parent event optimistically until the server returns a failure or the client
21132111gives up on sending the event, at which point the event should be de-aggregated and an
21142112error or similar shown. The client should be cautious to not aggregate an event twice if
21152113it has already optimistically aggregated the event. Clients are encouraged to take this
@@ -2118,7 +2116,7 @@ likely using the transaction ID as a temporary event ID until a proper event ID
21182116
21192117{{% boxes/warning %}}
21202118Due to history visibility restrictions, child events might not be visible to the user
2121- if they are in a section of history the user cannot see. This means any bundles which would
2119+ if they are in a section of history the user cannot see. This means any aggregations which would
21222120normally include those events will be lacking them and the client will not be able to
21232121locally aggregate the events either — relating events of importance (such as votes) should
21242122take into consideration history visibility.
0 commit comments