feat: Produce more informative errors when uploading media fails #1108

Merged
nex merged 3 commits from nex/feat/create-media into main 2025-10-12 19:42:57 +00:00
Owner

This pull request does the following things:

  • Makes uploads to /_matrix/media/v3/create that fail include a more helpful error message
  • Pro-actively reads the Content-Length header, if provided, to make sure that it doesn't exceed the configured limit. This allows servers to avoid wasting bandwidth and memory by checking if a body is viable before buffering it. Also allows clients that don't check the media config like Cinny to display an "upload failed" message before starting the upload.
This pull request does the following things: - Makes uploads to `/_matrix/media/v3/create` that fail include a more helpful error message - Pro-actively reads the `Content-Length` header, if provided, to make sure that it doesn't exceed the configured limit. This allows servers to avoid wasting bandwidth and memory by checking if a body is viable before buffering it. Also allows clients that don't check the media config like Cinny to display an "upload failed" message before starting the upload.
feat: Produce a more informative error when uploading media fails
All checks were successful
Documentation / Build and Deploy Documentation (pull_request) Successful in 48s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m22s
Release Docker Image / Build linux-amd64 (release) (pull_request) Successful in 6m1s
Release Docker Image / Build linux-arm64 (release) (pull_request) Successful in 6m9s
Release Docker Image / Create Multi-arch Release Manifest (pull_request) Successful in 18s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 9m34s
Release Docker Image / Build linux-arm64 (max-perf) (pull_request) Successful in 16m36s
Release Docker Image / Build linux-amd64 (max-perf) (pull_request) Successful in 16m43s
Release Docker Image / Create Max-Perf Manifest (pull_request) Successful in 17s
8e7f6b2f2e
feat: Produce even more informative errors when saving media fails
All checks were successful
Documentation / Build and Deploy Documentation (pull_request) Successful in 51s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m27s
Release Docker Image / Build linux-amd64 (release) (pull_request) Successful in 6m25s
Release Docker Image / Build linux-arm64 (release) (pull_request) Successful in 5m53s
Release Docker Image / Create Multi-arch Release Manifest (pull_request) Successful in 16s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 9m49s
Release Docker Image / Build linux-amd64 (max-perf) (pull_request) Successful in 14m24s
Release Docker Image / Build linux-arm64 (max-perf) (pull_request) Successful in 14m19s
Release Docker Image / Create Max-Perf Manifest (pull_request) Successful in 14s
eaafa4ce24
nex changed title from feat: Produce a more informative error when uploading media fails to feat: Produce more informative errors when uploading media fails 2025-10-09 02:28:13 +00:00
nex 2025-10-09 02:28:25 +00:00
feat: Proactively read Content-Length to reject oversized uploads
All checks were successful
Documentation / Build and Deploy Documentation (pull_request) Successful in 1m14s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 2m15s
Release Docker Image / Build linux-amd64 (release) (pull_request) Successful in 7m14s
Release Docker Image / Build linux-arm64 (release) (pull_request) Successful in 6m40s
Release Docker Image / Create Multi-arch Release Manifest (pull_request) Successful in 25s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 10m53s
Release Docker Image / Build linux-arm64 (max-perf) (pull_request) Successful in 14m1s
Release Docker Image / Build linux-amd64 (max-perf) (pull_request) Successful in 14m10s
Release Docker Image / Create Max-Perf Manifest (pull_request) Successful in 15s
1bec9e000f
Jade approved these changes 2025-10-12 12:01:07 +00:00
nex merged commit cb8f36444c into main 2025-10-12 19:42:57 +00:00
nex deleted branch nex/feat/create-media 2025-10-12 19:42:57 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
continuwuation/continuwuity!1108
No description provided.