From 52a721dd81e9187b46782c74e9110614d883fbac Mon Sep 17 00:00:00 2001 From: Serhat Dolmaci Date: Mon, 29 Jun 2026 21:23:16 +0300 Subject: [PATCH] fix(wasm): return error instead of silently ignoring encryption_key When encryption_key is provided in WASM builds, return a JsError instead of logging a warning and creating an unencrypted database. The previous behavior silently exposed sensitive message data in plaintext without the caller's knowledge. Closes #3797 --- bindings/wasm/src/client.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bindings/wasm/src/client.rs b/bindings/wasm/src/client.rs index ae951a51fe..cd5176b1b6 100644 --- a/bindings/wasm/src/client.rs +++ b/bindings/wasm/src/client.rs @@ -364,7 +364,7 @@ pub(crate) async fn build_store( }; if encryption_key.is_some() { - tracing::warn!("encryption_key is not supported in WASM and will be ignored"); + return Err(JsError::new("encryption_key is not supported in WASM builds")); } let db = WasmDb::new(&storage_option).await?;