matrix-org / matrix-org/matrix-js-sdk
Increase uploadContent timeout
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.2k
- Forks
- 704
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 40
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Open src/http-api/index.ts and inspect the uploadContent timeout handling around lines 72 and 106. Confirm how the timeout is refreshed by progress updates, then verify that uploads can remain in progress beyond 30 seconds and complete using the increased timeout.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100