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
Add read markers #1635
Add read markers #1635
Conversation
This is the spec for matrix-org#910 Fixes matrix-org#910 Some reverse engineering was required to work out the complete details as to how this works. In particular, the 405 for setting account data and the behaviour of m.read. References: * 405 for account data: https://github.com/matrix-org/synapse/blob/d69decd5c78c72abef50b597a689e2bc55a39702/synapse/rest/client/v2_alpha/account_data.py#L85-L90 * m.read behaviour: https://github.com/matrix-org/synapse/blob/d69decd5c78c72abef50b597a689e2bc55a39702/synapse/rest/client/v2_alpha/read_marker.py#L45-L52
Hum. That is not what 405s are for. I would be inclined to treat that as a synapse bug and spec a 400 instead. |
or, in fact, just leave the error case off for now. We should not be speccing M_UNKNOWN anywhere. |
How does speccing it as 400 with |
|
||
.. _module:read-markers: | ||
|
||
A "read marker" is a bookmark in the room's history where the user has last |
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.
This is not a description I find particularly easy to understand. I'm not sure it's helpful to distinguish between messages the user has seen but not read (we can't really tell that), and it's not true that the read receipt covers the most recently read message (if the user reads messages backwards by scrolling up, we don't update the RR - it only ever moves forward).
We need to start with the observation that since a user can scroll freely around the history of a room, there will be some parts of that history that the user has read, and some they have not.
So: we don't attempt to track the read state on a per-message basis: instead, we divide the room up into three sections: part 1, where the user has read all the messages (or indicated that they don't care); part 2, where the user may have read some messages and not others; and part 3, where the user hasn't seen any of the messages.
The read marker marks the last message in part 1 (ie, the last message where the user has seen all earlier messages); the read receipt marks the last message in part 2 (ie, the last message that the user has seen).
.. See the License for the specific language governing permissions and | ||
.. limitations under the License. | ||
|
||
Read Markers |
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.
could we call this section "The fully-read marker" (and update the text below to match)?
I'm not keen on speccing things that synapse doesn't do, but I'd prefer that to what we have currently. Could you just mention in the description that the api should return an error in this case? |
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.
lgtm
Rendered: see 'docs' status check
This is the spec for #910
Fixes #910
Some reverse engineering was required to work out the complete details as to how this works. In particular, the 405 for setting account data and the behaviour of m.read.
References: