Don't set a timeout for downloading media.
Your use case
What would you like to do?
n/a
Why would you like to do it?
For large files, if the download fails to complete within 30 seconds, the app will forcefully interrupt the download and return an error to the user. This includes video; audio or other types of files.
For this design, the following problems will arise: a) Large videos or audio (or other audiovisual media formats) will be forced to be interrupted by the app before starting to play; b) Large files will be forced to be interrupted by the app after downloading for a period of time; c) Data is wasted and the download cannot be successfully completed, resulting in a lose-lose situation. The above problems occurred under an excellent network condition (1000 Mbps WLAN) and tested with a 1.5 GB file. The only reason I can think of is to try to guide users to give up uploading too large files in the Matrix ecosystem.
How would you like to achieve it?
n/a
Have you considered any alternatives?
n/a
Additional context
n/a
Are you willing to provide a PR?
No
I think timeout is important, but it shouldn't timeout if it has active connection
There are a number of timeouts that could be at play here. For such a large file, it is more likely that your homeserver reverse proxy (nginx, caddy, traefic...) have timeouts that kick in.
If you are using the matrix.org homeserver, I don't know their limits, but I am pretty sure they don't want to serve as a file host for large files.
There are a number of timeouts that could be at play here. For such a large file, it is more likely that your homeserver reverse proxy (nginx, caddy, traefic...) have timeouts that kick in.
If you are using the matrix.org homeserver, I don't know their limits, but I am pretty sure they don't want to serve as a file host for large files.
I ran the above tests on a self-hosted Synapse instance. The timeout here means:
- The download started as expected and had a constant download speed, but was forcibly interrupted by the client because it failed to complete within 30 seconds. This means that some files over a certain size will definitely not be downloaded within 30 seconds even on a 1000Mbps LAN and without the intervention of a reverse proxy.
This client design is confusing. From all aspects (including database design and client design, etc.), Matrix does not seem to welcome large files.