LeastAuthority / winden

Winden is a free web application for secure, fast, and easy file transfers between devices in real-time
MIT License
54 stars 4 forks source link

Failing to Receive large files via web app #78

Open donpui opened 1 year ago

donpui commented 1 year ago

Winden app fails (actually crash on receive side) while sending large files (500 MB, 1 GB or more) depending on user PC, Mobile device, browsers. There is no consistency of file size which fails. Currently we are limiting to 200 MB of files in Web App. Destiny Desktop/Mobile applications don't have this issue.

Original issue: https://github.com/LeastAuthority/MyFileTransfer/issues/25 Internal bug: #OP 238

There were already few attempts to fix this memory leakage in w-w wasm: https://github.com/LeastAuthority/wormhole-william/pull/76 and web app.

Minimal client for experimentation: https://github.com/LeastAuthority/wormhole-william-minimal-client

Few more tasks, ideas to try out:

donpui commented 1 year ago

Performed some testing, as there were some refactoring, memory leak fixes.

Large File Transfer Test Cases - 2022-12-23.ods

Mostly fails receiving files on Mobile devices. Desktop is quite stable with 1 GB file transfer (send/receive). Even managed to send 5GB files.

Overall issue is on receiver side, when there is lack of memory to store all received data till full file received.

Also our current file size limitation on winden is incorrect setup. We should limit not only on sender side, but also on receiver, when file offer is presented.

donpui commented 1 year ago

@JustusFT @vu3rdd added few tasks to try out. Please put more, if something pops up.

May be we need to rethink whole process of receiving data, for example: may first get all bytes and push to temp file on system and only later on decrypt and generate downloadable file?

Also if we have mostly issues with mobile browsers, maybe we can separate limitation for desktop and mobile browser. For mobile experience, we could promote installable apps.

donpui commented 1 year ago

As issue still remains on Receiver side, which very much depends on Receiver computer/phone resources and browsers memory management.

Possible short term solutions:

cc: @JustusFT @wuan