Skip to content

Conversation

@bmarty
Copy link
Member

@bmarty bmarty commented Jul 19, 2021

SpiritCroc and others added 5 commits July 10, 2021 11:12
Previously, when a download was aborted (e.g. due to a bad internet
connection), a partly downloaded file was remaining in cache, which
would then be delivered upon later requests.
This can lead e.g. to chats where images aren't loading.

To avoid this, first download files to a temporary file that is not the
final cache file, and only rename/move it on finish.

Note that if you already have broken downloads, you still need to clear
cache once to get rid of them after this commit, but it should not
occur anymore afterwards.
Avoid incomplete downloads in cache
Will not always delete part files in case of crashes
@bmarty bmarty requested a review from BillCarsonFr July 19, 2021 09:08
}
}

var atomicFileCreator1: AtomicFileCreator? = null
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can it be renamed to something like encyptedCachedAtomicFile

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed to atomicFileDownload, it can be a clear file

}

var atomicFileCreator1: AtomicFileCreator? = null
var atomicFileCreator2: AtomicFileCreator? = null
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same renamed to clearCachedAtomicFime

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed to atomicFileDecrypt

@bmarty bmarty merged commit a34d445 into develop Jul 19, 2021
@bmarty bmarty deleted the feature/bma/part_dl branch July 19, 2021 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants