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
This commit is contained in:
Floris Bruynooghe
2023-03-30 22:23:50 +02:00
committed by GitHub
parent d6fdc7cb67
commit ef63e01632
2 changed files with 9 additions and 5 deletions

View File

@@ -1,5 +1,12 @@
# Changelog
## [1.112.3] - Unreleased
### Changes
### Fixes
- transfer::get_backup now frees ongoing process when cancelled. #4249
## [1.112.2] - 2023-03-30
### Changes
@@ -10,7 +17,6 @@
### Fixes
- Do not return media from trashed messages in the "All media" view. #4247
## [1.112.1] - 2023-03-27
### Changes

View File

@@ -392,12 +392,10 @@ pub async fn get_backup(context: &Context, qr: Qr) -> Result<()> {
let cancel_token = context.alloc_ongoing().await?;
let res = tokio::select! {
biased;
res = get_backup_inner(context, qr) => {
context.free_ongoing().await;
res
}
res = get_backup_inner(context, qr) => res,
_ = cancel_token.recv() => Err(format_err!("cancelled")),
};
context.free_ongoing().await;
res
}