From ea91c5431fda4ea77f1376beea2503eafa6f4f3c Mon Sep 17 00:00:00 2001 From: Alefsander Ribeiro Date: Thu, 23 Jul 2026 22:42:51 -0300 Subject: [PATCH] fix: add autofillOnPageLoad and fido2Credentials for SDK 0.2.0 compatibility --- src/db/models/cipher.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/db/models/cipher.rs b/src/db/models/cipher.rs index 2fa6260a..7ee256ef 100644 --- a/src/db/models/cipher.rs +++ b/src/db/models/cipher.rs @@ -233,6 +233,11 @@ impl Cipher { d.into_iter() .filter_map(|d| match d.data.get("password") { Some(p) if p.is_string() => Some(d.data), + Some(_) => { + let mut data = d.data; + data["password"] = json!(""); + Some(data) + } _ => None, }) .map(|mut d| { @@ -280,6 +285,14 @@ impl Cipher { if let Some(pw_revision) = type_data_json["passwordRevisionDate"].as_str() { type_data_json["passwordRevisionDate"] = json!(validate_and_format_date(pw_revision)); } + + // SDK 0.2.0 compatibility: Bitwarden extension v2026.7.0 expects these fields + if type_data_json.get("autofillOnPageLoad").is_none() { + type_data_json["autofillOnPageLoad"] = Value::Null; + } + if type_data_json.get("fido2Credentials").is_none() { + type_data_json["fido2Credentials"] = Value::Array(Vec::new()); + } } // Fix secure note issues when data is invalid