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

MSC2388: Toward the EDU-to-PDU transition: Read Receipts. #2388

Open
wants to merge 1 commit into
base: old_master
Choose a base branch
from
Open
Changes from all commits
Commits
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
23 changes: 23 additions & 0 deletions proposals/2388-edu-as-pdu--receipt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# MSC2388 - Read-Receipt PDU type

### Background

Receipts are a feature in Matrix intended for clients to acknowledge a message. The only type of
receipt at present is the m.read read-receipt for when the user has seen a message. This feature
is specified as an EDU such that the reliability of their transmission is not guaranteed and there
is no record of them. They were designed this way because an order of magnitude more receipts are
expected by this system than other PDU messages.

### Problem

In practice, implementations treat read-receipt EDU's no different than other PDU messages. Upon
Copy link
Member

Choose a reason for hiding this comment

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

read receipts are (currently) treated fundamentally differently; you only have to track the most recent place that a user has read up to (or possibly in future, the ranges of events that they've read over, but it's still aggregated data you end up persisting). you don't care about modelling the full history of precisely when they read up to which point.

My same concerns apply as for /~https://github.com/matrix-org/matrix-doc/pull/2389/files#r366632795 - we simply don't want to clog up the DAG with irrelevant data.

This could make sense if EDUs didn't exist... but they do, and for good reason.

Copy link

Choose a reason for hiding this comment

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

we simply don't want to clog up the DAG with irrelevant data

What do you think of #2388 (comment) ?

Copy link

Choose a reason for hiding this comment

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

It just came to me that you may, in fact, want to store read receipts for every message, forever, in order to achieve reliable and verifiable auditorium room (equivalent of telegram channels) view counters.

reception they must be persisted for effective client synchronization. Implementations also employ
Copy link
Member

Choose a reason for hiding this comment

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

That's an inaccurate statement. Notably, Quotient doesn't persist read receipts - it keeps them in memory but as soon as it's restarted, it loads a new map of read receipts from the server, not caring at all (why would it?) about the track record of read receipts.

Copy link
Member Author

Choose a reason for hiding this comment

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

It's probably referring to the server. As you just said, you rely on the server to persist the "ephemeral" events (since it's obviously unacceptable from an UX PoV for read receipts to disappear when the client is restarted).

Copy link
Member

Choose a reason for hiding this comment

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

Well, that's still inaccurate even for server-side implementations, since persistence does not imply adding things to DAG.

additional complexity to transmit prior EDU's to other servers long after they were received.
These implementation choices were made to provide a consistent, expected user experience, where
the same receipts render the same for everyone. That consistency is beneficial to the social
atmosphere.

### Solution

We specify the Event type m.receipt. Within the content of this event, an m.relates_to with a
rel_type of m.read provides and replaces the functionality of the existing receipt EDU.
Comment on lines +22 to +23
Copy link

Choose a reason for hiding this comment

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

Speaking of replacing stuff, I suppose this proposal could describe that previous m.read events should be replaced by the latest versions, using the improved redactions, which I believe would allow servers/clients to skip/not store forever previous versions.

Copy link
Member

@uhoreg uhoreg Jan 15, 2020

Choose a reason for hiding this comment

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

What improved redactions? I'm not aware of any proposal to change redactions, other than adding a mass-redactions API, which AFAIK doesn't change how redactions work.

Copy link

Choose a reason for hiding this comment

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

#447 and #1763 come to my mind.

Copy link
Member

Choose a reason for hiding this comment

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

#1763 only deals with time-limited messages, which would not work well for read receipts; read receipts "expire" when replaced by another one, rather than after a certain amount of time. This would be more applicable to typing notifications, though I suspect that the servers would still need to keep a bunch of information about the event, so that the DAG doesn't have random holes in it that would prevent the room from working correctly.

Copy link
Contributor

Choose a reason for hiding this comment

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

Care to elaborate? We have avatar changes registered on every room a user participates, this seems much more pertinent to the room than that.

(replying in a thread for easier future replies)

m.read doesn't seem like something you'd want in your timeline for permanent storage. It is irrelevant in the future when which user read what. So storing this information permanently is an unnecessary overhead, which could cause problems down the line, especially with clients in e.g. embedded enviroments which can't handle that many events.

Copy link

Choose a reason for hiding this comment

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

Using PDUs doesn't imply in permanent storage, per se. See my review above.

Copy link
Contributor

Choose a reason for hiding this comment

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

Destructing events for m.read also seems like a bad idea as, if you e.g. don't log in for a week, suddenly all your read indicators are off.

In sorus opinion sticking with EDUs seems like the best option here.

Copy link

Choose a reason for hiding this comment

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

Destructing events for m.read also seems like a bad idea as, if you e.g. don't log in for a week, suddenly all your read indicators are off.

Assuming self destructing events, correct? What if instead of self destructing read indicators simply replace the previous, regardless of which one your server/client has currently resolved.

In sorus opinion sticking with EDUs seems like the best option here.

It seems to me that improved redactions made EDUs redundant, which is why there's some movement to push that away from the protocol.

Copy link
Contributor

Choose a reason for hiding this comment

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

Assuming self destructing events, correct? What if instead of self destructing read indicators simply replace the previous, regardless of which one your server/client has currently resolved.

Sounds like you are trying to re-create EDUs here, so why not take the existing model that works?

Copy link
Member

Choose a reason for hiding this comment

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

It does but I don't think it stores those receipts in a DAG - too much of a hassle for a centralised service. I'm also really unsure how many people actually look at the list of message readers (I only did it out of curiosity and never needed it). And the current MSC doesn't describe such new semantics. In fact, in doesn't really describe any changes in the semantics at all so I struggle to understand how such new receipts would work end-to-end.

Copy link
Contributor

Choose a reason for hiding this comment

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

If I mark a room as read, I usually make sure, that I have at least read all the mentions. So while read receipts aren't an exact way to see if someone read the message, you can at least use them to ping someone again, if they sent a read receipt but didn't act on the message in the way you expected. So I think read receipts are good enough for that, if they are actually persisted (and don't just get replaced on the next sync, since I may want to check, if the person actually marked the message as read a few hours ago and not just a few seconds ago).

Copy link
Member

Choose a reason for hiding this comment

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

I can buy that in the context of a, say, a direct chat, or a very small (<10 members) room; but in that case (specifically for messages you want to track attention on) you might equally just ask the person whether they've seen the message and what they can say to it. My perception is that this is a fairly corner case (How often did you really miss such function?) and it doesn't justify a rather sweeping change; and the MSC doesn't really elaborate neither on use cases, nor on consequences of such change.

To rephrase: there might be merit in such change but from the text of the MSC it's terribly hard to see any because it doesn't mention neither use cases, nor consequences of the change; neither for the spec texts (you cannot just name an event a PDU, you have to define a new schema), nor for clients and servers.

Choose a reason for hiding this comment

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

I look at read receipts in WhatsApp all the time. Like I'm sending out a link to a jitsi call and I want to know whether people didn't read it or just don't want to join.
It might be useful to have a distinction between small groupchats and large public channels, because the semantics are very different for a lot of things.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, I'd probably agree that's a good case for more persistent read receipts but not for every message and, probably, not visible for everyone (not in "large public channels", one they become a thing in its own right in Matrix). Somewhat resembles an e-mail with a request for read confirmation.