fix: file transfer, jobs lost if conn is not established (#13635)

Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
fufesou
2025-11-26 19:15:32 +08:00
committed by GitHub
parent ae06f27372
commit 4ed8696d1d
2 changed files with 4 additions and 2 deletions

View File

@@ -1054,7 +1054,9 @@ impl<T: InvokeUiSession> Remote<T> {
}
pub async fn sync_jobs_status_to_local(&mut self) -> bool {
log::info!("sync transfer job status");
if !self.is_connected {
return false;
}
let mut config: PeerConfig = self.handler.load_config();
let mut transfer_metas = TransferSerde::default();
for job in self.read_jobs.iter() {

View File

@@ -2009,7 +2009,7 @@ pub async fn io_loop<T: InvokeUiSession>(handler: Session<T>, round: u32) {
}
let mut remote = Remote::new(handler, receiver, sender);
remote.io_loop(&key, &token, round).await;
remote.sync_jobs_status_to_local().await;
let _ = remote.sync_jobs_status_to_local().await;
}
#[cfg(not(any(target_os = "android", target_os = "ios")))]