voelin-core: claim the generic signed client version, as before

native_version() took the first signed version containing "3.6" (3.6.0,
build 1647595742, from 2022) while its documentation and its test said the
generic tuple (3.?.? [Build: 5680278000]); the test failed. Main sent the
generic one (tsclientlib's default), whose build passes a server's minimum
client version; a real old build may be refused. Each platform's generic
tuple again, matched exactly (not the Windows DEBUG one).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEpqsPES27Eacue91u3d2Q
This commit is contained in:
Claude committed 2026-10-04 18:02:22 +00:00
1 parent 8cc4cd4863
commit 63f18ea8d9
1 file changed
+6 -1
+6 -1
View File
@@ -10,6 +10,9 @@ use tsclientlib::Version;
const VERSIONS_CSV: &str = include_str!("../../proto/tsproto-structs/declarations/Versions.csv");
/// The signed generic version of every platform, tsclientlib's default.
const GENERIC_VERSION: &str = "3.?.? [Build: 5680278000]";
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct KnownVersion {
pub version: String,
@@ -92,9 +95,11 @@ fn compatibility_version(os: &str) -> Result<Version> {
"ios" => "iOS",
_ => bail!("no signed compatibility version for operating system {os:?}"),
};
// The library's generic version: its build passes servers' minimum client
// version, which a real (older) build such as 3.6.0 may not.
known_versions()
.into_iter()
.find(|version| version.platform == platform && version.version.contains("3.6"))
.find(|version| version.platform == platform && version.version == GENERIC_VERSION)
.with_context(|| format!("missing signed compatibility version for {platform}"))?
.to_version()
}