Deltachat-desktop: Call stop_io()/start_io() before/after backup export

Created on 1 Mar 2021  路  7Comments  路  Source: deltachat/deltachat-desktop

See https://github.com/deltachat/deltachat-core-rust/pull/2255

For Android, I already made a PR: https://github.com/deltachat/deltachat-android/pull/1822/files

For backup import it's not necessary as IO is not running before doing an import.

For key import/export, it doesn't hurt but isn't necessary.

All 7 comments

does this need to go into 1.15 (core 50) or is this specific to the new core?

If you only use core releases, then it has to be done before you switch to the next release.

But it has no negative consequences to do it right now, and it's a 2-line-change, so if you ask me, do it now :)

Also, by stopping the IO before you do backup export, you already now prevent a possible database corruption (without upgrading the core), yet another reason to do it now :rocket:

ok, doing it now. but question - why is the ui responsible for this and not the core?

why is the ui responsible for this and not the core?

yeah, good question, no sure if it was discussed before, so only my 2cents without having followed all discussions to this fix before:

i think, it makes some sense as dc_imex() is also called without IO on initial setup for importing things (IO cannot run there as configuration is not yet available). later, IO is started by the UI.

also, probably the more important point, having functions that implicitly stop IO may easily result in race conditions.

so, even if it cause a few more lines, i think it is a clearer approach to leave start/stop IO completely in the hand of one instance.

but yes, as always, there are many ways to do things :)

can we make the backup fail if the io is still running? is this issue/point documented in the documentation? (asking because issues in current ui's won't help new future ui's)

can we make the backup fail if the io is still running?

this is actually the case, https://github.com/deltachat/deltachat-core-rust/blob/master/src/imex.rs#L689

is this issue/point documented in the documentation?

yip: https://c.delta.chat/classdc__context__t.html#ab04a07bb49363824f6fe3b03e6aaaca7

Was this page helpful?
0 / 5 - 0 ratings