bug: Incorrect handling of /sync?since=<batch_token> request when the timeout parameter is omitted. #2462

Closed
opened 2026-11-05 15:06:01 +00:00 by se-prok · 1 comment

What is the bug?

When the /sync?since=<batch_token> request is made without the timeout parameter, it results in a 30‑second timeout instead of an immediate response, as mandated by The Matrix documentation at https://spec.matrix.org/latest/client-server-api/#syncing:

"
timeout

By default, this is 0, so the server will return immediately even if the response is empty.
"

Steps to reproduce

  1. Client sends: GET /_matrix/client/v3/sync?since=<batch_token> HTTP/1.1
  2. Server responds only after 30 sec

Server name and version

continuwuity 26.9.1 (0727d564a)

Additional context

No response

### What is the bug? When the `/sync?since=<batch_token>` request is made without the `timeout` parameter, it results in a 30‑second timeout instead of an immediate response, as mandated by The Matrix documentation at https://spec.matrix.org/latest/client-server-api/#syncing: " timeout By default, this is 0, so the server will return immediately even if the response is empty. " ### Steps to reproduce 1) Client sends: GET /_matrix/client/v3/sync?since=<batch_token> HTTP/1.1 2) Server responds only after 30 sec ### Server name and version continuwuity 26.9.1 (0727d564a) ### Additional context _No response_
Owner

This block needs to check if the timeout is None or zero in addition to checking if the request is full state or empty:

let response = build_sync_events(&services, &body).await?;
if body.body.full_state
|| !(response.rooms.is_empty()
&& response.presence.is_empty()
&& response.account_data.is_empty()
&& response.device_lists.is_empty()
&& response.to_device.is_empty())
{
return Ok(response);
}

This block needs to check if the timeout is `None` or zero in addition to checking if the request is full state or empty: https://forgejo.ellis.link/continuwuation/continuwuity/src/commit/add66bd0b7e2af8ed6011aae092c5ac0715b4c25/src/api/client/sync/v3/mod.rs#L205-L214
nex closed this issue 2026-11-17 10:06:32 +00:00
Sign in to join this conversation.
No milestone
No assignees
2 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#2462
No description provided.