matrix-org / matrix-org/matrix-rust-sdk

"Sliding Sync Version is Missing" Error When Client has Been Configured and Discovered Native Sliding Sync (iOS)

Open
#5,421 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
2.3k
Forks
500
Avg merge
1d 16h
Merged PRs (30d)
106

Description

When creating a Matrix Client using the Swift bindings for iOS, I get an interesting issue when I attempt to do the following:

```swift
let availableSlidingSyncVersions = await client.availableSlidingSyncVersions()
AppLogger.shared.info("Available Sliding Sync versions: \(availableSlidingSyncVersions)")
let syncService = try await client.syncService().finish()
await syncService.start()
```

I verify that the sliding sync version list is `[MatrixRustSDK.SlidingSyncVersion.native]` but the `try await` still fails instantly, saying that `"Sliding sync version is missing"`. I have checked the source code for this SDK and don't see anything strange about the logic that could be causing this error:

```rust
let version = self.version.unwrap_or_else(|| client.sliding_sync_version());

if matches!(version, Version::None) {
return Err(crate::error::Error::SlidingSync(Box::new(Error::VersionIsMissing)));
}
```

Am I doing something incorrectly? The client is authorized and built with either `.discoverNative` or `.native` when making the client:

```swift
let client = try await ClientBuilder()
.slidingSyncVersionBuilder(versionBuilder: .discoverNative)
...
```

**Note:**
Our `/_matrix/client/versions` does contain a `org.matrix.simplified_msc3575` entry under `unstable_features`

Contributor guide

Open the contributing guide

Research direction

Start with the Swift reproduction using ClientBuilder.slidingSyncVersionBuilder, availableSlidingSyncVersions(), and syncService().finish(), then trace the Rust version-selection logic shown in the issue. Compare the discovered native version with the client state at sync-service creation. Done means explaining why the version is reported as available yet missing, or identifying the SDK behavior that must change.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, rust, swift
Domain
distributed-systems, mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.