element-hq / element-hq/dendrite

Relations endpoint error when passed sync tokens

Open
#2,944 0 comments 0 reactions 0 assignees View on GitHub
C-Sync-API O-Frequent T-Defect
Dominant language
Go
Stars
965
Forks
101
PR merge metrics
No merged PRs in 30d

Description

*This issue was originally created by [**@clokep**](https://github.com/clokep) at .*

A `next_batch` token from `/sync` should be usable on the `/relations` endpoint. This was missing a test in complement, but now has one at matrix-org/complement#586. Dendrite [errors on this test](https://github.com/matrix-org/complement/actions/runs/3950654938/jobs/6763480796):

```
room_relations_test.go:266: CSAPI.MustDoFunc GET http://127.0.0.1:32983/_matrix/client/v1/rooms/%21ZeEvqcyz84VeEjw9:hs1/relations/$eQNMO057jy_F8f-ClA6m8Bi7UsTbNrnYX2-f4eID4BU?dir=f&limit=3&to=s11_0_0_0_0_1_1_0_1 returned non-2xx code: 500 Internal Server Error - body: {"message":"strconv.Atoi: parsing \"s11_0_0_0_0_1_1_0_1\": invalid syntax"}
```

[Relevant spec](https://spec.matrix.org/v1.5/client-server-api/#get_matrixclientv1roomsroomidrelationseventid):

> `from`: The pagination token to start returning results from. If not supplied, results start at the most recent topological event known to the server.
>
> Can be a `next_batch` or `prev_batch` token from a previous call, or a returned `start` token from [`/messages`](https://spec.matrix.org/v1.5/client-server-api/#get_matrixclientv3roomsroomidmessages), or a `next_batch` token from [`/sync`](https://spec.matrix.org/v1.5/client-server-api/#get_matrixclientv3sync).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.