-
Couldn't load subscription status.
- Fork 414
MSC4023: Thread ID for 2nd order-relation #4023
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
base: main
Are you sure you want to change the base?
Changes from 5 commits
f34e69e
d771c62
8699c34
036666c
fc9a8c4
541f210
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| # MSC4023: Thread ID for second-order relation | ||
|
|
||
| [MSC3981](https://github.com/matrix-org/matrix-spec-proposals/pull/3981) defines | ||
| a way to recursively load relations in a thread context. However this does not | ||
| let clients determine with certainty in what timeline an event coming from a `/sync` | ||
| should end up in. | ||
|
|
||
| If the related event is unknown to the client, the only way to partition things | ||
| correctly is to fetch the related event and confirm whether this event belongs to | ||
| a thread or not. | ||
|
|
||
| This proposal wants to reduce the amount of work required for clients to partition | ||
| events with certainty in a time efficient manner. | ||
|
|
||
| ## Proposal | ||
|
|
||
| All events in a thread and the second-order relation events should add a `thread_id` | ||
| property in their `unsigned` field definition, referencing the thread root – as | ||
| defined in MSC3440. | ||
|
|
||
| ```jsonc | ||
| { | ||
| "thread_id": "$event_id" | ||
MatMaul marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
| ``` | ||
|
|
||
| All events that are not part of a thread should fill the `thread_id` property with | ||
| the special value `main` – as defined in MSC3771. | ||
|
|
||
| If a server does not have the first-order event, the unsigned `thread_id` property | ||
| should be filled with a `null` value. When the server gets a hold of the first-order | ||
| event, it should retroactively update the `thread_id` property and communicate the | ||
| change to clients. | ||
germain-gg marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ## Potential issues | ||
|
|
||
| ### Database query performances | ||
|
|
||
| This could have performance implications on the server side, requiring more work | ||
| to be performed when fetching events in a room. | ||
|
|
||
| ### Missing first-order relation | ||
|
|
||
| It is possible that a server will have the second-order event, but not have the | ||
| first-order event (eg, it has received a reaction over federation, but has not | ||
| yet received the event being reacted to). | ||
|
|
||
| ## Alternatives | ||
|
|
||
| If "[MSC3051: A scalable relation format](https://github.com/matrix-org/matrix-spec-proposals/pull/3051)" | ||
| was to be adopted, this MSC would be nulled. | ||
|
||
|
|
||
| ## Security considerations | ||
|
|
||
| No security considerations | ||
|
|
||
| ## Unstable prefix | ||
|
|
||
| While this MSC is not considered stable by the specification, implementations _must_ use | ||
| `org.matrix.msc4023.thread_id` in place of `thread_id`. | ||
|
|
||
| ## Dependencies | ||
|
|
||
| This MSC does not have dependencies | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that this sentence needs a bit more clarity with regards to who is adding the
thread_idproperty. When I first read this, I thought that it was added by the sending client, but clients don't setunsigned, so it can't be that. I'm guessing then, that it's set by the recipient's server, but I think it would help to be explicit.Also, what endpoints is it returned in? I'm guessing all the endpoints that return events?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hopefully I've clarified this.