Skip to content

Commit ef63e01

Browse files
authored
fix(imex): transfer::get_backup must always free ongoing process (#4249)
* fix(imex): transfer::get_backup must always free ongoing process When the ongoing process is cancelled it is still the responsibility of whoever took out the ongoing process to free it. This code was only freeing the ongoing process when completed normally but not when cancelled. * add changelog
1 parent d6fdc7c commit ef63e01

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## [1.112.3] - Unreleased
4+
5+
### Changes
6+
7+
### Fixes
8+
- transfer::get_backup now frees ongoing process when cancelled. #4249
9+
310
## [1.112.2] - 2023-03-30
411

512
### Changes
@@ -10,7 +17,6 @@
1017
### Fixes
1118
- Do not return media from trashed messages in the "All media" view. #4247
1219

13-
1420
## [1.112.1] - 2023-03-27
1521

1622
### Changes

src/imex/transfer.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -392,12 +392,10 @@ pub async fn get_backup(context: &Context, qr: Qr) -> Result<()> {
392392
let cancel_token = context.alloc_ongoing().await?;
393393
let res = tokio::select! {
394394
biased;
395-
res = get_backup_inner(context, qr) => {
396-
context.free_ongoing().await;
397-
res
398-
}
395+
res = get_backup_inner(context, qr) => res,
399396
_ = cancel_token.recv() => Err(format_err!("cancelled")),
400397
};
398+
context.free_ongoing().await;
401399
res
402400
}
403401

0 commit comments

Comments
 (0)