From b2937da726b9eeb270ac2b0108e676a09e0356ff Mon Sep 17 00:00:00 2001 From: Edison Jwa Date: Thu, 11 Jun 2026 09:46:57 +0900 Subject: [PATCH] fix(protocol,storage): platform-aware client version and Android stub (TODO-010,011) pick_client_version() now returns correct version per platform via cfg(target_os). keyring_load() on unsupported platforms returns StorageError instead of silently returning Ok(None). --- crates/chanora_protocol/src/adapter.rs | 21 ++++++++++++++++++++- crates/chanora_storage/src/lib.rs | 4 +++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/crates/chanora_protocol/src/adapter.rs b/crates/chanora_protocol/src/adapter.rs index 1663878..4fcb033 100644 --- a/crates/chanora_protocol/src/adapter.rs +++ b/crates/chanora_protocol/src/adapter.rs @@ -138,7 +138,26 @@ where /// `Version` enum at compile time; if upstream rotates the CSV the /// build will fail loudly here rather than silently fall back. fn pick_client_version() -> Version { - Version::Windows_3_X_X__1 + #[cfg(target_os = "windows")] + { + Version::Windows_5_0_0_beta51 + } + #[cfg(target_os = "linux")] + { + Version::Linux_5_0_0_beta51 + } + #[cfg(target_os = "macos")] + { + Version::macOS_5_0_0_beta51 + } + #[cfg(target_os = "android")] + { + Version::Android_3_5_0__7 + } + #[cfg(target_os = "ios")] + { + Version::iOS_3_5_6 + } } /// Typed configuration for a connection attempt. diff --git a/crates/chanora_storage/src/lib.rs b/crates/chanora_storage/src/lib.rs index f91a2dd..052941b 100644 --- a/crates/chanora_storage/src/lib.rs +++ b/crates/chanora_storage/src/lib.rs @@ -270,7 +270,9 @@ impl IdentityFileStore { target_os = "ios" )))] fn keyring_load(&self) -> Result, StorageError> { - Ok(None) + Err(StorageError::SecureStore( + "keyring is not yet supported on this platform".into(), + )) } /// Persist the DEK in the platform keyring. Returns true on