From 2ecb5373077d49cde9139740bd19ed83de16baa9 Mon Sep 17 00:00:00 2001 From: Simon Laux Date: Wed, 14 Jan 2026 15:35:57 +0000 Subject: [PATCH] api!: jsonrpc: remove `contacts` from `FullChat`. To migrate load contacts on demand via `get_contacts_by_ids` using `FullChat.contactIds` (#7282) closes #6945 ### Why not deprecate it instead? Because empty contact list is a more annoying-to-find bug in your app than failing to build or getting undefined at runtime. Also you would not see the deprecated hints anyway because for that you need autogenerated types and those only exist for typescript currently. --- deltachat-jsonrpc/src/api/types/chat.rs | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/deltachat-jsonrpc/src/api/types/chat.rs b/deltachat-jsonrpc/src/api/types/chat.rs index c6c1dd181..42d69ffa6 100644 --- a/deltachat-jsonrpc/src/api/types/chat.rs +++ b/deltachat-jsonrpc/src/api/types/chat.rs @@ -10,7 +10,6 @@ use serde::{Deserialize, Serialize}; use typescript_type_def::TypeDef; use super::color_int_to_hex_string; -use super::contact::ContactObject; #[derive(Serialize, TypeDef, schemars::JsonSchema)] #[serde(rename_all = "camelCase")] @@ -48,7 +47,6 @@ pub struct FullChat { chat_type: JsonrpcChatType, is_unpromoted: bool, is_self_talk: bool, - contacts: Vec, contact_ids: Vec, /// Contact IDs of the past chat members. @@ -83,20 +81,6 @@ impl FullChat { let contact_ids = get_chat_contacts(context, rust_chat_id).await?; let past_contact_ids = get_past_chat_contacts(context, rust_chat_id).await?; - let mut contacts = Vec::with_capacity(contact_ids.len()); - - for contact_id in &contact_ids { - contacts.push( - ContactObject::try_from_dc_contact( - context, - Contact::get_by_id(context, *contact_id) - .await - .context("failed to load contact")?, - ) - .await?, - ) - } - let profile_image = match chat.get_profile_image(context).await? { Some(path_buf) => path_buf.to_str().map(|s| s.to_owned()), None => None, @@ -132,7 +116,6 @@ impl FullChat { chat_type: chat.get_type().into(), is_unpromoted: chat.is_unpromoted(), is_self_talk: chat.is_self_talk(), - contacts, contact_ids: contact_ids.iter().map(|id| id.to_u32()).collect(), past_contact_ids: past_contact_ids.iter().map(|id| id.to_u32()).collect(), color, @@ -150,7 +133,6 @@ impl FullChat { } /// cheaper version of fullchat, omits: -/// - contacts /// - contact_ids /// - fresh_message_counter /// - ephemeral_timer