deltachat-core-rust icon indicating copy to clipboard operation
deltachat-core-rust copied to clipboard

send backup: fail quickly on insufficient storage

Open r10s opened this issue 2 years ago • 2 comments

receiving a large backup can take several dozen minutes - if, at 90%, the device is out of storage, this is very frustrating - not only that the backup did not succeed, also much time was wasted.

this issue is especially true for low-budget devices, which have poor transfer rates due to poor wi-fi hardware - and often little storage space as well. plus, there may be an overall poor network, bad router, far away from router ...

my suggestion is that dc_receive_backup() returns as soon as possible if it is clear that there is insufficient storage, with a nice error set (so no UI adaptions are needed).

my first idea was to add the storage needed to the qr code, however, @dignifiedquire pointed out in the Dev chat that additional information in the qr code are not needed, iroh already knows the size, so it’s a matter of figuring out what to do with that info.

while being a huge UX improvement, much more than "nice to have", this issue is still an optimisation, so i would not see that as absolutely necessary for a first release. depends a bit on how hard it is to do :)

r10s avatar Mar 21 '23 22:03 r10s

iroh already sends over a size hint of the total size being sent over. That is only once the transfer is started, so you need to establish the connection first. But there is a callback that the receiving device can hook into and do something right at the start of the transfer, before it starts pulling in all the data. And it can decide to abort at that point.

flub avatar Mar 22 '23 14:03 flub

Related issue about insufficient storage: #4307

link2xt avatar Jul 25 '23 12:07 link2xt