The current MatrixHttpApi uploadContent implementation sets the timeout to 30 seconds, and refreshes the timeout every time there is a progress update. However, when connecting via Tor, large file uploads consistently time out.
Tor has large network buffers and ingests far more than the circuit is capable of transferring within 30 seconds. Progress updates end up being longer than 30 seconds apart, leading to an upload timeout.
As an example, when the timeout is raised to 300 seconds, a 25MB file upload progresses to 100% within 1 second, and then sits at 100% for the next two and a half minutes, before completing successfully. Without raising the timeout, the same file upload consistently fails after 31 seconds.
Please increase the uploadContent timeout from 30 seconds to 300 seconds, at least.
The current MatrixHttpApi uploadContent implementation sets the timeout to 30 seconds, and refreshes the timeout every time there is a progress update. However, when connecting via Tor, large file uploads consistently time out.
Tor has large network buffers and ingests far more than the circuit is capable of transferring within 30 seconds. Progress updates end up being longer than 30 seconds apart, leading to an upload timeout.
As an example, when the timeout is raised to 300 seconds, a 25MB file upload progresses to 100% within 1 second, and then sits at 100% for the next two and a half minutes, before completing successfully. Without raising the timeout, the same file upload consistently fails after 31 seconds.
Please increase the uploadContent timeout from 30 seconds to 300 seconds, at least.
https://github.com/matrix-org/matrix-js-sdk/blob/develop/src/http-api/index.ts#L72 https://github.com/matrix-org/matrix-js-sdk/blob/develop/src/http-api/index.ts#L106
Thank you.