-
-
Notifications
You must be signed in to change notification settings - Fork 90
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
Fixes for backup transfer #6027
Conversation
bc15715
to
eda7140
Compare
7a77398
to
69fbf4b
Compare
There is a corresponding Android PR with progress bar fixes: deltachat/deltachat-android#3333 |
69fbf4b
to
bb4d65e
Compare
5c20c6a
to
9f4a329
Compare
).race(async { | ||
drop_token.cancelled().await; | ||
Err(format_err!("Backup provider dropped")) | ||
}).await { | ||
warn!(context, "Error while handling backup connection: {err:#}."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIUC, if the transfer is cancelled during endpoint.accept(..)
, we do context.emit_event(EventType::ImexProgress(0))
, and write nothing to the log.
If the transfer is cancelled during handle_connection(..)
, we write a message to the log, don't emit an event, and continue with the next iteration of the loop, (i.e. try to call endpoint.accept(..)
) again. (this was fixed)
This seems surprising?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed by emitting progress 0. Cancellation during transfer is still logged as a warning unlike cancellation of accept loop, but it is just logging and not shown in the UI anyway.
fe912eb
to
c9a9cd6
Compare
With deltachat/deltachat-core-rust#6027, when exporting a backup, the counter stays at 0% while running housekeeping and vacuuming the database, which takes 10 seconds on my device. Showing "One moment... 0%" for 10 seconds (or longer on slower devices / with bigger accounts) might make users think that it's not working and abort the process. So, instead, simply show "One moment..." until the progress reaches 1%.
c9a9cd6
to
582b379
Compare
Before this change progress bar only started when database is already transferred. Database is usually the largest file in the whole transfer, so the transfer appears to be stuck for the sender. With this change progress bar starts for backup export as soon as connection is received and counts bytes transferred over the connection using AsyncWrite wrapper. Similarly for backup import, AsyncRead wrapper counts the bytes received and emits progress events.
This is already documented in JSON-RPC API, but in fact ongoing process was not allocated.
582b379
to
99a8a40
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉🎉🎉 More fixed bugs!
With deltachat/deltachat-core-rust#6027, when exporting a backup, the counter stays at 0% while running housekeeping and vacuuming the database, which takes 10 seconds on my device. Showing "One moment... 0%" for 10 seconds (or longer on slower devices / with bigger accounts) might make users think that it's not working and abort the process. So, instead, simply show "One moment..." until the progress reaches 1%.
Closes #5993
fix: make it possible to cancel ongoing backup transfer
Before this change clicking "cancel" did not actually cancel the backup transfer if connection has already been established.
fix: smooth progress bar for backup transfer
Before this change progress bar only started
when database is already transferred.
Database is usually the largest file
in the whole transfer, so the transfer appears
to be stuck for the sender.
With this change progress bar
starts for backup export
as soon as connection is received
and counts bytes transferred over the connection
using AsyncWrite wrapper.
Similarly for backup import,
AsyncRead wrapper counts the bytes
received and emits progress events.
With this change Delta Chat desktop, from which I'm transferring, immediately shows the progress bar:
fix: make backup reception cancellable by stopping ongoing process
This is already documented in JSON-RPC API,
but in fact ongoing process was not allocated.
fix: emit progress 0 if get_backup() fails
Otherwise receiver gets stuck if the sender cancels backup transfer.