-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
Threaded receipt EDU shape down /sync makes it impossible to express certain valid receipts #1727
Comments
This is invalid -- there can be two receipts, but they would be an unthreaded receipt and The shape is lacking though and you're correct though, we were constrained by the current shape of receipts / EDUs down sync. (I thought this was called out in the MSC, but seems I never added this to the potential issues section.) |
I was just writing the same as clokep, but he's faster than me :)
N+2, I think? One for each thread, one for the |
I checked the MSC and PR comments but failed to see anyone mention it, hence raising this issue. Given
then sure,
|
Additionally, federation has a similar issue since they're mapped room -> type -> user. Synapse has some complicated code to ensure that receipts on different threads don't stomp each other. Instead of being able to send a single receipt EDU the best you can now do is N EDUs where N is the maximum threaded receipts in the same room by the same user (or something like that). |
So the combination of:
means that I think this is a valid concern, because receipt data is lost between users irreversibly. I don't know how the complex unread notification code will handle things if receipts are being dropped seemingly randomly. |
If I've understood this correctly, this is very much a theoretical problem since an unthreaded receipt is implicitly a receipt for all threads, so a threaded receipt for the same event is irrelevant. However, the spec doesn't make this clear and also doesn't specify that the HS should give the unthreaded receipt precedence, so we should make an MSC to fix that, which I believe is what Kegan is doing. Any client that supports threaded receipts will have to support both anyway and so should already be doing the right thing. |
@dbkr's insight is the key to fixing this, because it means unthreaded (missing It looks like this problem was independently discovered by @andybalaam in #1684 and the solution proposed was to just not batch EDUs, which is simply unnecessary given with the correct replacement rules you can safely batch. |
* Add failing test for matrix-org/matrix-spec#1727 * Logs are fun * Update with semantics of MSC4102 * Also test over federation
I'm struggling to grasp at a glance what action this needs.
|
Threaded read receipts got added in MSC3771 - they look like this down /sync:
It is my understanding that receipts form a key-value store, where the key is a 3-uple of
(user_id, room_id, thread_id)
, with the value of the read(event_id, ts)
. This means a user can have a N+1 receipts in a room, one for each thread ID and one unthreaded receipt (ignoring private receipts). However, the JSON shape restricts the ability to express the following data:It restricts it because the JSON shape is keyed off the 2-uple (event_id, user_id) - the key is too broad. The net result is that in the sliding sync proxy and Synapse, these receipts are inexpressible and one will be dropped in a undefined manner.
It may be that it's silly for clients to send this particular set of receipts, but given how we want to work with thread-aware and non-thread-aware clients, it's not unrealistic that clients may decide to send 2 receipts for an event: one for "unthreaded" for the benefit of thread unaware clients and one for the
thread_id
for thread-aware clients. If they do this, things break.Element-Web does exactly this:
and it's possible to send both for the same event ID:
The text was updated successfully, but these errors were encountered: