polar
polar copied to clipboard
Large files being uploaded keeps the full file in memory
Description
As a follow up from #6780, and the merged solution #7740, we can now handle large files without erroring in the browser. However the full file is read into memory during the file upload which is both unnecessarily slow (We don't start pushing chunks to the server before the entire file is read through and hashed), but also wasteful and in the worst case the tab will crash if the user is uploading a too large file with too little memory.
Expected Behavior
- We can upload files without loading them fully into memory.
- We store the hash of the full file as well as the chunks to allow for verification of the file integrity.