From 5dbf9e6c2947ba9b409c3e361eecd9f48476db0e Mon Sep 17 00:00:00 2001 From: zarzet <42882290+zarzet@users.noreply.github.com> Date: Sun, 18 Oct 2026 22:08:47 +0700 Subject: [PATCH] refactor(network): drop the ignored insecure_tls parameter inside Rust NetworkService::set_network_compatibility_options ignored the insecure_tls flag by design because TLS verification is never disabled. Remove the parameter from the network service and the extension environment so the dead flag no longer travels through internal layers. The UniFFI method keeps its signature: Kotlin and Swift still pass the flag, and the mobile binding accepts and ignores it until the binding and channel cleanup lands separately. --- rust_backend/crates/extensions/src/environment.rs | 4 +--- rust_backend/crates/mobile/src/extensions.rs | 4 +++- rust_backend/crates/network/src/client.rs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/rust_backend/crates/extensions/src/environment.rs b/rust_backend/crates/extensions/src/environment.rs index b09afb8e..f61304a6 100644 --- a/rust_backend/crates/extensions/src/environment.rs +++ b/rust_backend/crates/extensions/src/environment.rs @@ -219,11 +219,9 @@ impl ExtensionEnvironment { pub fn set_network_compatibility_options( &self, allow_http: bool, - insecure_tls: bool, ) -> Result<(), EnvironmentError> { let _operation = self.enter()?; - self.network - .set_network_compatibility_options(allow_http, insecure_tls); + self.network.set_network_compatibility_options(allow_http); Ok(()) } diff --git a/rust_backend/crates/mobile/src/extensions.rs b/rust_backend/crates/mobile/src/extensions.rs index 57f09e67..0b27e96d 100644 --- a/rust_backend/crates/mobile/src/extensions.rs +++ b/rust_backend/crates/mobile/src/extensions.rs @@ -193,8 +193,10 @@ impl ExtensionEnvironment { allow_http: bool, insecure_tls: bool, ) -> Result<(), JsExtensionError> { + // Accepted for binding compatibility and ignored: TLS verification is never disabled. + let _ = insecure_tls; self.inner - .set_network_compatibility_options(allow_http, insecure_tls) + .set_network_compatibility_options(allow_http) .map_err(Into::into) } diff --git a/rust_backend/crates/network/src/client.rs b/rust_backend/crates/network/src/client.rs index 0abd47af..8eb56fa3 100644 --- a/rust_backend/crates/network/src/client.rs +++ b/rust_backend/crates/network/src/client.rs @@ -279,7 +279,7 @@ impl NetworkService { /// Native compatibility requests may retry HTTPS over HTTP. Extension /// sessions retain their manifest policy. TLS verification is never disabled. - pub fn set_network_compatibility_options(&self, allow_http: bool, _insecure_tls: bool) { + pub fn set_network_compatibility_options(&self, allow_http: bool) { let mut pool = self.pool.lock().expect("HTTP pool lock"); if pool.allow_http_fallback == allow_http { return;