- Operating System (Linux/Mac/Windows/iOS/Android): All
- Core Version: 2.59.0
- Client Version: 2.59.1
Expected behavior
add_transport is cancelled.
Actual behavior
|
info!(self, "No ongoing process to stop.",); |
In practice this means that pressing "Cancel" doesn't actually cancel anything.
Steps to reproduce the problem
- Call
rpc.add_transport_from_qr
- Immediately (or almost immediately) call
stop_ongoing_process.
The problem is that there are quite a few awaits before the alloc_ongoing.
|
let cancel_channel = self.alloc_ongoing().await?; |
The biggest one is probably stop_io
This bug definitely affects Desktop
https://github.com/deltachat/deltachat-desktop/blob/820deb5fcb0b0f350fce1041122dddad60196948/packages/frontend/src/components/dialogs/ConfigureProgressDialog.tsx#L65-L88
And most likely also Android, but I didn't try:
https://github.com/deltachat/deltachat-android/blob/8a389bdf24c773fc7153bc86088316bdeaa952cb/src/main/java/org/thoughtcrime/securesms/InstantOnboardingActivity.java#L583-L598
I see two options:
- Redesign the API. Such that the user can stop a process by its revocation handle / token / signal. Can be either a parameter provided to
add_transport or its return value (although add_transport doesn't return until it's finished).
- Offload the problem to users (client devs). Tell them in the docs that they need to wait for at least one
ConfigureProgress (or whatever else) event before they can call stop_ongoing.
Expected behavior
add_transportis cancelled.Actual behavior
core/src/context.rs
Line 821 in 2cacdbf
In practice this means that pressing "Cancel" doesn't actually cancel anything.
Steps to reproduce the problem
rpc.add_transport_from_qrstop_ongoing_process.The problem is that there are quite a few
awaits before thealloc_ongoing.core/src/configure.rs
Line 133 in fbbe56c
The biggest one is probably
stop_iocore/src/configure.rs
Line 160 in fbbe56c
This bug definitely affects Desktop
https://github.com/deltachat/deltachat-desktop/blob/820deb5fcb0b0f350fce1041122dddad60196948/packages/frontend/src/components/dialogs/ConfigureProgressDialog.tsx#L65-L88
And most likely also Android, but I didn't try:
https://github.com/deltachat/deltachat-android/blob/8a389bdf24c773fc7153bc86088316bdeaa952cb/src/main/java/org/thoughtcrime/securesms/InstantOnboardingActivity.java#L583-L598
I see two options:
add_transportor its return value (althoughadd_transportdoesn't return until it's finished).ConfigureProgress(or whatever else) event before they can callstop_ongoing.