Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

/messages endpoint returns end token identical to from token #12102

@johannescpk

Description

@johannescpk

Description

Goal is to fetch messages in a room backwards.

Steps to reproduce

  • My client first does a /sync to get the latest next_batch token
  • I'm then using that token to pass it into the messages endpoint as { from: $next_batch, direction: "b", .. }.
  • The response from the server has an end field that's the same as the next_batch token that was used in the initial request, additionally to all room messages.

So it seems there's an issue with synapse not leaving the end token empty if it reaches the end of the timeline.

For reference, here's the raw response from synapse, where start and end are identical.

matrix_sdk::http_client: Got response: Response { status: 200, version: HTTP/1.1, headers: {"transfer-encoding": "chunked", "server": "Synapse/1.53.0", "date": "Mon, 28 Feb 2022 14:45:37 GMT", "content-type": "application/json", "cache-control": "no-cache, no-store, must-revalidate", "access-control-allow-origin": "*", "access-control-allow-methods": "GET, HEAD, POST, PUT, DELETE, OPTIONS", "access-control-allow-headers": "X-Requested-With, Content-Type, Authorization, Date"}, body: b"{"chunk":[],"start":"t1-915_1917_28_2_75_1_1_77_1","end":"t1-915_1917_28_2_75_1_1_77_1"}" }

Version information

  • Homeserver: Local dev instance

If not matrix.org:

  • Version: 1.53.0

  • Install method: docker hub

  • Platform: x86 64bit, docker container

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-Spec-Complianceplaces where synapse does not conform to the specS-MinorBlocks non-critical functionality, workarounds exist.T-DefectBugs, crashes, hangs, security vulnerabilities, or other reported issues.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions