From c925c04de088104f365f8fe9ce6a81da6bfcf72f Mon Sep 17 00:00:00 2001 From: MinchinWeb Date: Sun, 25 Oct 2026 09:49:02 -0600 Subject: [PATCH] Send null org key for unconfirmed members in sync (#7850) Since #7666 the sync profile's `organizationsNew` also lists Accepted (not yet confirmed) memberships. Their `akey` is still empty, so the response contained `"key": ""`, whereas upstream sends `null` until the member is confirmed. Bitwarden Android 2026.9 prefers `organizationsNew` and only skips organizations whose key is null. The empty string is handed to the SDK, which rejects it ("Invalid asymmetric type, got type 0 with 1 parts"), so the whole `initializeOrgCrypto` call fails: none of the user's organization keys are loaded and every organization item and collection fails to decrypt on that device. Send null for an empty key, matching upstream and the existing handling of the user key in `GET /api/accounts/keys`. Claude-Session: https://claude.ai/code/session_011UHYQWTz2PkXSCfucaRMZB Co-authored-by: Claude Opus 5.5 --- src/db/models/organization.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/db/models/organization.rs b/src/db/models/organization.rs index 72684782..25d03dfc 100644 --- a/src/db/models/organization.rs +++ b/src/db/models/organization.rs @@ -523,7 +523,8 @@ impl Membership { // These are per user "userId": self.user_uuid, - "key": self.akey, + // Accepted (not yet confirmed) members have no key yet; send null like upstream, not "" + "key": (!self.akey.is_empty()).then_some(&self.akey), "status": self.status, "type": membership_type, "enabled": true,