From 2c97b41e879a84f99147fcae299f4f7404e377cf Mon Sep 17 00:00:00 2001 From: Kees van den Broek Date: Mon, 1 Jun 2026 11:04:42 +0200 Subject: [PATCH] fix(sends): emit hideEmail as non-null boolean in sync response The /api/sync response serialized a Send hide_email field directly from Option, so a NULL value in the sends table (the column is Nullable with no default) produced "hideEmail": null. The Bitwarden Android client deserializes SyncResponseJson.Send.hideEmail as a non-null Kotlin Boolean and aborts the entire sync with a JsonDecodingException when it encounters null. Web, desktop and CLI clients coerce null to false, so only accounts with at least one Send are affected and only on Android. Default None to false at the serialization boundary, matching the official Bitwarden server where hideEmail is non-nullable. This needs no database migration and fixes both legacy NULL rows and any future NULLs. The hide_email field stays Option internally. --- src/db/models/send.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/db/models/send.rs b/src/db/models/send.rs index 0a2f1a2a..a35bcf8d 100644 --- a/src/db/models/send.rs +++ b/src/db/models/send.rs @@ -161,7 +161,7 @@ impl Send { "password": self.password_hash.as_deref().map(|h| BASE64URL_NOPAD.encode(h)), "authType": if self.password_hash.is_some() { SendAuthType::Password as i32 } else { SendAuthType::None as i32 }, "disabled": self.disabled, - "hideEmail": self.hide_email, + "hideEmail": self.hide_email.unwrap_or(false), "revisionDate": format_date(&self.revision_date), "expirationDate": self.expiration_date.as_ref().map(format_date),