Skip to content

fix(imex): transfer::get_backup must always free ongoing process #4249

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
6 changes: 2 additions & 4 deletions src/imex/transfer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down