Skip to content

chathistory: add cursors#525

Closed
emersion wants to merge 1 commit into
ircv3:masterfrom
emersion:chathistory-cursors
Closed

chathistory: add cursors#525
emersion wants to merge 1 commit into
ircv3:masterfrom
emersion:chathistory-cursors

Conversation

@emersion

@emersion emersion commented Jun 2, 2023

Copy link
Copy Markdown
Contributor

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
Comment thread extensions/chathistory.md
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
Copy Markdown
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
Copy Markdown
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.

Comment thread extensions/chathistory.md

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
Copy Markdown
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
Copy Markdown
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

progval commented Jun 2, 2023

Copy link
Copy Markdown
Contributor

Impl in M51: progval/matrix2051#55

@emersion

emersion commented Apr 3, 2025

Copy link
Copy Markdown
Contributor Author

I don't think this is worth the added complexity.

@emersion emersion closed this Apr 3, 2025
@progval

progval commented Apr 3, 2025

Copy link
Copy Markdown
Contributor

I still believe it is. At worst for clients it's not harder than using msgid, and servers can just use msgid as cursor.

@emersion

emersion commented Apr 3, 2025

Copy link
Copy Markdown
Contributor Author

Feel free to open a new PR and work on it if you believe so.

@emersion emersion mentioned this pull request Mar 26, 2026
8 tasks
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.

3 participants