Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MSC1849: Proposal for m.relates_to aggregations #1849

Closed
wants to merge 49 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
0b5dab5
a very WIP draft of an aggregations MSC to replace #441
ara4n Feb 4, 2019
e03457d
incorporate notes from sync with erik
ara4n Apr 5, 2019
8567149
shower thoughts
ara4n Apr 5, 2019
ed2a3a0
more notes from today's sync with erik
ara4n Apr 5, 2019
07050a4
Update with new proposal
erikjohnston Apr 30, 2019
25b879b
fixup
erikjohnston Apr 30, 2019
f50de1f
Add some notes about extended annotations
erikjohnston Apr 30, 2019
ebb25e0
further updates from RLing with Erik
ara4n Apr 30, 2019
7db56e1
Merge branch 'master' of github.com:matrix-org/matrix-doc into matthe…
erikjohnston Apr 30, 2019
a9d2efa
Fix spacing
erikjohnston Apr 30, 2019
c47391e
Add proposed pagination API
erikjohnston May 1, 2019
1b24334
Flesh out the pagination API a bit
erikjohnston May 1, 2019
a12db5b
following RL review
ara4n May 1, 2019
3255ae0
Add edit example
erikjohnston May 2, 2019
e0f165e
Example has been added
erikjohnston May 2, 2019
d38d7a7
try to converge towards a proper reviewable draft
ara4n May 12, 2019
08de484
yet more notes on yet more edge cases
ara4n May 13, 2019
e78e7ad
Add a coherent overview; remove a bunch of FIXMEs
ara4n May 13, 2019
dacae1f
Add TOC
ara4n May 13, 2019
5375a23
markdown tweaks
ara4n May 13, 2019
0f7cf5e
typos
ara4n May 13, 2019
4bb8d6b
s/contents/content/g
ara4n May 13, 2019
60a3d61
fix wording
ara4n May 13, 2019
117ae97
Update proposals/1849-aggregations.md
ara4n May 13, 2019
8627fb7
Update proposals/1849-aggregations.md
ara4n May 13, 2019
2dde2c1
add m.new_content
ara4n May 14, 2019
b166d6c
Merge branch 'master' into matthew/msc1849
ara4n Jun 25, 2019
adb240d
WIP commit of rewrite to MSC1849
ara4n Jun 27, 2019
a6c8b65
WIP commit of rewrite to MSC1849
ara4n Jun 27, 2019
081ea3d
write up the new gappy sync stuff
ara4n Jul 5, 2019
9c90cc1
s/stale_relations/stale_events/
ara4n Jul 5, 2019
3f3d60e
rewrite the paginations section
ara4n Jul 16, 2019
d98d5b3
finish rewriting MSC1849, in theory, incorporating all review so far
ara4n Jul 29, 2019
c313489
Merge pull request #2154 from matrix-org/matthew/msc1849-rewrite
ara4n Jul 29, 2019
fa7c338
fix typos
ara4n Jul 29, 2019
1409119
Update proposals/1849-aggregations.md
ara4n Jul 30, 2019
e8fde9d
Update proposals/1849-aggregations.md
ara4n Jul 30, 2019
4d236c6
incorporate some of the PR review
ara4n Jul 30, 2019
f63b20a
remaining review
ara4n Jul 30, 2019
b228688
clarify `m.replace` bundle structure
ara4n Jul 30, 2019
fb4446f
wording tweaks
ara4n Jul 31, 2019
6225aae
Apply suggestions from code review
ara4n Jul 31, 2019
6751de6
PR review
ara4n Aug 1, 2019
eab778d
clarify ignored users
ara4n Aug 1, 2019
a63d27e
incorporate erik feedback
ara4n Aug 1, 2019
4e8d370
POST /event
ara4n Aug 1, 2019
e816233
clarify errors on /aggregations
ara4n Aug 1, 2019
4a96865
add bruno's local echo considerations
ara4n Aug 1, 2019
e57033a
arbitrarily restrict trailing slashes for now
ara4n Aug 1, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 23 additions & 8 deletions proposals/1849-aggregations.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,26 @@ and
}
```

or if building a relation DAG (for ordering for edits, and for pulling in missing relations after a federation outage):

```json
"type": "m.reaction",
"contents": {
"m.text": "👍",
"m.relates_to": {
"event_id": ["$another:event.com", "$another2:event.com"]
}
}
```

And then the server just blitzes through `m.relates_to.event_id` and builds up all the relationships based on that field.
This is kinda similar to pik's proposal below, but without the JSON schema.

`event_id` should take either a string or a list of strings, to support relation DAGs (needed for ordering edits)
XXX: `event_id` should take either a string or a list of strings, to support relation DAGs (needed for ordering edits)

## CS API considerations

Then, whenever the event is served down the CS API, we inline all the relationships for a given event (modulo filters)?
Then, whenever the event is served down the CS API, we inline the relations for a given event (modulo filters)?

For edits, we'd want the most recent relation (by default)
For reactions, we want all the reaction objects (or ideally their sum?)
Expand Down Expand Up @@ -97,8 +109,8 @@ So:

## Sending relations

```json
PUT /_matrix/client/r0/rooms/{roomId}/send_relation/{parent_id}/{eventType}/{txnId}
```json
{
"m.text": "👍",
}
Expand All @@ -111,9 +123,9 @@ adding the `parent_id` as one parent, but also adding any other dangling relatio

TODO:

/sync
/messages
/context
* /sync
* /messages
* /context

## Pagination considerations

Expand Down Expand Up @@ -169,8 +181,11 @@ XXX: We have a problem with resynchronising relations after a gap in federation.
We have no way of knowing that an edit happened in the gap to one of the events
we already have. So, we'll show inconsistent data until we backfill the gap.
* We could write this off as a limitation.
* Or we could make relations a DAG, so we can spot holes at the next relation, and
go walk the DAG to pull in the missing relations?
* Or we could make *ALL* relations a DAG, so we can spot holes at the next relation, and
go walk the DAG to pull in the missing relations? Then, the next relation for an event
could pull in any of the missing relations.
* Could we also ask the server, after a gap, to provide all the relations which happened during the gap to events whose root preceeded the gap.
* "Give me all relations which happened between this set of forward-extremities when I lost sync, and the point i've rejoined the DAG, for events which preceeded the gap"?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens when the set of relations becomes very large?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

excellent question. god knows; this is being swept under the carpet for now.


In future, we might want to aggregate relational events (e.g. send a summary of the events, rather than the
actual original events). This requires the payload to be non-E2E encrypted, and would also require some kind of
Expand Down