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

chathistory: add cursors #525

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

emersion
Copy link
Contributor

@emersion emersion commented Jun 2, 2023

This improves reliability of timestamp-based queries by using an opaque cursor. A message at a page boundary can be missed by a client if one of its neighbours has the same timestamp.

This improves reliability of timestamp-based queries by using an
opaque cursor. A message at a page boundary can be missed by a
client if one of its neighbours has the same timestamp.
@emersion emersion mentioned this pull request Jun 2, 2023
CHATHISTORY TARGETS <timestamp> <timestamp> <limit>

The `target` parameter specifies a single buffer (channel or nickname) from which history is to be retrieved. If a nickname is given as the `target` then the server SHOULD include history sent between the current user and the target nickname, including outgoing messages ("self messages"). The server SHOULD attempt to include history involving other nicknames if either the current user or the target nickname has changed during the requested timeframe.

A `timestamp` parameter MUST have the format `timestamp=YYYY-MM-DDThh:mm:ss.sssZ`, as in the [server-time][server-time] extension. A `msgid` parameter MUST have the format `msgid=foobar`, as in the [message-ids][message-ids] extension.
A `timestamp` parameter MUST have the format `timestamp=YYYY-MM-DDThh:mm:ss.sssZ`, as in the [server-time][server-time] extension. A `msgid` parameter MUST have the format `msgid=foobar`, as in the [message-ids][message-ids] extension. A `cursor` parameter MUST have the format `cursor=foobar`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Add cursor to the possible MSGREFTYPES?

Copy link
Contributor

Choose a reason for hiding this comment

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

Why? If servers don't support cursors, they simply won't send CHATHISTORY CURSOR. Meanwhile, MSGREFTYPES might be useful for non-CHATHISTORY stuff in the future, where cursor wouldn't make sense.


CHATHISTORY CURSORS <target> <next> [prev]

`next` is a a cursor which can be used to query the next page of messages. `prev` is a cursor which can be used to query the previous page of messages, it MUST only be returned in response to `CHATHISTORY AROUND`.
Copy link
Contributor

Choose a reason for hiding this comment

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

What if a server has a prev cursor but no next cursor in response to CHATHISTORY AROUND?

Copy link
Contributor

Choose a reason for hiding this comment

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

What about CHATHISTORY CURSORS <target> {<next>|*} {<prev>|*} for CHATHISTORY AROUND and CHATHISTORY CURSORS ` for the others?

progval added a commit to progval/matrix2051 that referenced this pull request Jun 2, 2023
@progval
Copy link
Contributor

progval commented Jun 2, 2023

Impl in M51: progval/matrix2051#55

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants