From 98847ad185ee98c32c7a5c521f28ac7667eea44a Mon Sep 17 00:00:00 2001 From: ICantThinkOfAName-tech Date: Fri, 16 Oct 2026 21:28:21 +0200 Subject: [PATCH] Require the SDK Sends flag for Item Sends Clients only decrypt (and rotate the keys of) Item Sends through the SDK, gated by `pm-30110-sdk-sends-api`. Without it they silently drop Item Sends and recipients can't open them, so support that flag and only enable Item Sends when both flags are set. Co-Authored-By: Claude Opus 5.5 --- src/api/core/sends.rs | 12 +++++++++--- src/config.rs | 1 + 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/api/core/sends.rs b/src/api/core/sends.rs index 2e2381ed..76c8273c 100644 --- a/src/api/core/sends.rs +++ b/src/api/core/sends.rs @@ -175,11 +175,17 @@ fn create_send(data: SendData, user_id: UserId) -> ApiResult { } const ITEM_SENDS_FEATURE_FLAG: &str = "pm-34203-temporary-item-sharing"; +// Clients can only decrypt (and rotate the keys of) Item Sends through the SDK +const SDK_SENDS_FEATURE_FLAG: &str = "pm-30110-sdk-sends-api"; -/// Item Sends (sharing a vault item through a temporary link) are opt-in through the client feature flag. +/// Item Sends (sharing a vault item through a temporary link) are opt-in through the client feature flags, +/// both are needed for clients to handle them. pub fn item_sends_enabled() -> bool { - parse_experimental_client_feature_flags(&CONFIG.experimental_client_feature_flags(), &FeatureFlagFilter::ValidOnly) - .contains_key(ITEM_SENDS_FEATURE_FLAG) + let flags = parse_experimental_client_feature_flags( + &CONFIG.experimental_client_feature_flags(), + &FeatureFlagFilter::ValidOnly, + ); + flags.contains_key(ITEM_SENDS_FEATURE_FLAG) && flags.contains_key(SDK_SENDS_FEATURE_FLAG) } /// Whether a Send can be shown to its owner or a recipient, Item Sends are hidden while the feature is disabled. diff --git a/src/config.rs b/src/config.rs index 014fef60..8746d399 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1440,6 +1440,7 @@ pub const SUPPORTED_FEATURE_FLAGS: &[&str] = &[ // Platform Team "pm-30529-webauthn-related-origins", // Tools Team + "pm-30110-sdk-sends-api", "pm-34203-temporary-item-sharing", // Vault Team "pm-32009-new-item-types",