fix: use error codes from the spec #2451

Open
bardi wants to merge 4 commits from bardi/continuwuity:fix/spec-error-codes into main

2026-11-04

fix: Return 405 when setting m.fully_read via account data
All checks were successful
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Prek / Check changed files (pull_request) Successful in 10s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m18s
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 6s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 7m50s
The spec requires servers to reject client writes to server-managed
account data types with 405 M_BAD_JSON. We returned 400.
2026-11-04 21:45:32 +11:00
fix: Return M_UNKNOWN_DEVICE for unknown masqueraded appservice devices
When an appservice masqueraded as a device_id that does not exist for
the user, we returned 403 M_FORBIDDEN. The spec requires 400
M_UNKNOWN_DEVICE.
2026-11-04 21:45:32 +11:00
fix: Return M_PROFILE_TOO_LARGE for oversize profiles
Profile updates that would push the profile over 64 KiB were rejected
with an untyped error, producing a 500. The spec requires 400
M_PROFILE_TOO_LARGE, which ruma now provides.
2026-11-04 21:45:32 +11:00
fix: Return M_KEY_TOO_LARGE for oversize profile keys
Profile keys longer than 255 bytes were rejected with 413 M_TOO_LARGE.
The spec requires 400 M_KEY_TOO_LARGE, which ruma now provides.
2026-11-04 21:45:32 +11:00