From 955f79923ad86cdf986491607f39a58086f88e2b Mon Sep 17 00:00:00 2001 From: Hocuri Date: Thu, 22 Jan 2026 19:11:10 +0100 Subject: [PATCH] fix: Restart i/o when there are new transports in a sync message (#7640) --- src/transport.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/transport.rs b/src/transport.rs index abf50d14a..6343968ab 100644 --- a/src/transport.rs +++ b/src/transport.rs @@ -9,6 +9,7 @@ //! and configured list of connection candidates. use std::fmt; +use std::pin::Pin; use anyhow::{Context as _, Result, bail, format_err}; use deltachat_contact_tools::{EmailAddress, addr_normalize}; @@ -760,11 +761,18 @@ pub(crate) async fn sync_transports( .await?; if modified { + tokio::task::spawn(restart_io_if_running_boxed(context.clone())); context.emit_event(EventType::TransportsModified); } Ok(()) } +/// Same as `context.restart_io_if_running()`, but `Box::pin`ed and with a `+ Send` bound, +/// so that it can be called recursively. +fn restart_io_if_running_boxed(context: Context) -> Pin + Send>> { + Box::pin(async move { context.restart_io_if_running().await }) +} + /// Adds transport entry to the `transports` table with empty configuration. pub(crate) async fn add_pseudo_transport(context: &Context, addr: &str) -> Result<()> { context.sql