Bug: sync always omits timeline for left rooms #332

Closed
opened 2024-05-03 22:31:28 +00:00 by olivia-fl · 2 comments
olivia-fl commented 2024-05-03 22:31:28 +00:00 (Migrated from github.com)

Steps to reproduce:

  • leave a room
  • issue a /sync request, either without a since parameter or with a since parameter from before the user left the room

The expected result is that the sync response will contain a timeline field for the left room that either has all events between since and the point where the user left the room, or has "limited": true and all events between timeline.prev_batch and the point where the user left the room. The current result is that the timeline field is missing entirely.

Notes

There's an associated TODO comment in the code here.

The code currently does this for left rooms:

Timeline {
	limited: false,
	prev_batch: Some(next_batch_string.clone()),
	events: Vec::new(),
}

If we set limited: true instead, then this would technically be a spec-compliant response, however this ruma bug means that the timeline field will be omitted from the response anyway.

### Steps to reproduce: - leave a room - issue a `/sync` request, either without a `since` parameter or with a `since` parameter from before the user left the room The expected result is that the sync response will contain a `timeline` field for the left room that either has all events between `since` and the point where the user left the room, or has `"limited": true` and all events between `timeline.prev_batch` and the point where the user left the room. The current result is that the `timeline` field is missing entirely. ### Notes There's an associated TODO comment in the code [here](https://github.com/girlbossceo/conduwuit/blob/42e3567153f20ace6f287d46fff2d7c070b68840/src/api/client_server/sync.rs#L74). The code currently does this for left rooms: ```rust Timeline { limited: false, prev_batch: Some(next_batch_string.clone()), events: Vec::new(), } ``` If we set `limited: true` instead, then this would technically be a spec-compliant response, however [this ruma bug](https://github.com/ruma/ruma/pull/1796) means that the `timeline` field will be omitted from the response anyway.
Owner

Looks like this was fixed in upstream ruma. we should probably take a look at some point too

Looks like this was [fixed in upstream ruma](https://github.com/ruma/ruma/pull/1796). we should probably take a look at some point too
Owner

Fixed by !1132.

Fixed by !1132.
This discussion has been locked. Commenting is limited to contributors.
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
continuwuation/continuwuity#332
No description provided.