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:
1 file changed
+6
-1
@@ -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()
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user