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

Need a way to paginate forwards from the start of a room's timeline #601

Closed
richvdh opened this issue Mar 30, 2020 · 6 comments
Closed

Need a way to paginate forwards from the start of a room's timeline #601

richvdh opened this issue Mar 30, 2020 · 6 comments
Labels
A-Client-Server Issues affecting the CS API enhancement A suggestion for a relatively simple improvement to the protocol

Comments

@richvdh
Copy link
Member

richvdh commented Mar 30, 2020

Sometimes paginating forwards from the very start of a room is a useful thing to do. It's possible if you have the event id of the create event, but otherwise is tricky.

@turt2live turt2live added A-Client-Server Issues affecting the CS API enhancement A suggestion for a relatively simple improvement to the protocol labels Mar 30, 2020
@richvdh richvdh transferred this issue from matrix-org/matrix-spec-proposals Mar 1, 2022
@MadLittleMods
Copy link
Contributor

As a cumbersome workaround, we can use MSC3030 to jump to the first event in the room:

  1. GET /_matrix/client/v1/rooms/<roomID>/timestamp_to_event?ts=0&dir=f to get the first event in the room
  2. GET /_matrix/client/r0/rooms/<roomId>/context/<eventId>?limit=0 to get a pagination token
  3. Use /messages?dir=f to paginate forwards

@richvdh
Copy link
Member Author

richvdh commented Mar 28, 2022

I think MSC3567 solves this?

@MadLittleMods
Copy link
Contributor

MadLittleMods commented Mar 29, 2022

In Synapse, GET /_matrix/client/v3/rooms/{roomId}/messages?dir=f doesn't seem to work to get the first messages in the room as MSC3567 mentions ❌. It looks like it's at the most recent position in the timeline looking forward.

{
    "chunk": [],
    "start": "s957_0_0_0_0_0_0_0_0",
    "end": "s957_0_0_0_0_0_0_0_0"
}

GET /_matrix/client/v3/rooms/{roomId}/messages?dir=b does get the latest events in the room as MSC3567 mentions though.

@richvdh
Copy link
Member Author

richvdh commented Mar 29, 2022

GET /_matrix/client/v3/rooms/{roomId}/messages?dir=f doesn't seem to work to get the first messages in the room as MSC3567 mentions x.

That sounds like a synapse bug rather than a spec one, tbh.

(though it does make me wonder: what happens if the local server doesn't have the start of the room history?)

@MadLittleMods
Copy link
Contributor

MadLittleMods commented Mar 29, 2022

(though it does make me wonder: what happens if the local server doesn't have the start of the room history?)

👍 Can't backfill forwards. It's a weird scenario.

@richvdh
Copy link
Member Author

richvdh commented Apr 5, 2022

ok, so it seems like we can close this? The spec at least has a way to do this. @MadLittleMods: if you find synapse doesn't implement it correctly, please can you file a bug over there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Client-Server Issues affecting the CS API enhancement A suggestion for a relatively simple improvement to the protocol
Projects
None yet
Development

No branches or pull requests

3 participants