fix(client): save transfer jobs before the WebRTC close wait

Reconnect starts the next round without waiting for this one, and the next
round loads the saved transfer jobs as soon as it logs in. This round saved
them only after its close wait, which can last up to a second, so a fast
reconnect could load stale jobs and not resume an interrupted transfer.
Save them before the wait. The wait discards what arrives, so the jobs do
not change during it, and the save after the round finds nothing new.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkig1bcC5Xrr1uwX47b
This commit is contained in:
RustDeskandClaude Opus 5.5 committed 2026-12-05 00:46:49 +08:00
1 parent dc0cdc336e
commit 39dc8f884d
1 file changed
+3
+3
View File
@@ -764,6 +764,9 @@ impl<T: InvokeUiSession> Remote<T> {
// wait, or this round's cleanup removes the channel the next one is using.
#[cfg(any(target_os = "windows", feature = "unix-file-copy-paste"))]
clipboard::remove_channel_by_conn_id(self.client_conn_id);
// The next round also loads the saved transfer jobs as soon as it logs in.
// The wait discards what arrives, so the jobs no longer change after this.
let _ = self.sync_jobs_status_to_local().await;
// Dropping the stream can discard the queued reason, and then the controlled
// side keeps this session for a password-free reconnect. It closes once it
// has read the reason.