Skip to content

Building the SyncService can fail if a /versions request fails #5845

Description

@poljar

Since #5618 building a SyncService might fail to build because a /versions requests fails.

The builder attempts to check if support for MSC4306 is enabled on the homeserver.

if client.enabled_thread_subscriptions() {
let server_features = client
.supported_versions()
.await
.map_err(|err| Error::SlidingSync(err.into()))?
.features;
if !server_features.contains(&FeatureFlag::from("org.matrix.msc4306")) {
warn!(
"Thread subscriptions extension is requested on the client, but the server doesn't advertise support for it: not enabling."
);
} else {
debug!("Enabling the thread subscriptions extension");
builder = builder.with_thread_subscriptions_extension(
assign!(http::request::ThreadSubscriptions::default(), {
enabled: Some(true),
limit: Some(ruma::uint!(10))
}),
);
}
}

Critically, /versions nowadays can also fail due to token expiration, for more info see #5816 and #5822. This combination means that building a SyncService can simply fail due to a network request failing. Just enabling token refresh on the /versions request results in a deadlock: #5825.

Two things that would be nice to achieve:

  1. Remove the possibility of a network failure to fail the SyncService builder.
  2. Allow token refres for the /versions request.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions