feat: PDU handler refresh #1944

Merged
nex merged 16 commits from nex/fix/pdu-handler-refresh into main 2026-07-11 16:28:28 +00:00

2026-07-11

style: Remove redundant length check for dag build
Some checks failed
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 6s
Checks / Prek / Check changed files (pull_request) Successful in 5s
Documentation / Build and Deploy Documentation (pull_request) Successful in 1m5s
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m10s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 2m0s
Checks / Prek / Check changed files (push) Has been cancelled
Checks / Prek / Clippy and Cargo Tests (push) Has been cancelled
Release Docker Image / Build linux-amd64 (release) (push) Has been cancelled
Release Docker Image / Build linux-arm64 (release) (push) Has been cancelled
Release Docker Image / Create Multi-arch Release Manifest (push) Has been cancelled
Release Docker Image / Build linux-amd64 (max-perf) (push) Has been cancelled
Release Docker Image / Build linux-arm64 (max-perf) (push) Has been cancelled
Release Docker Image / Create Max-Perf Manifest (push) Has been cancelled
Release Docker Image / Release Binaries (push) Has been cancelled
Release Docker Image / Mirror Images (push) Has been cancelled
Documentation / Build and Deploy Documentation (push) Has been cancelled
Checks / Prek / Pre-commit & Formatting (push) Has been cancelled
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 9m3s
2026-07-11 17:27:42 +01:00
refactor: Reduce complexity of incoming PDU handling
* Ignores any events pushed without a room ID
* Removes needless clones for PDU size checking
* Removes incorrect ACL check in incoming handler
* Fast-path handling already handled outlier events
* Remove redundant same-room checks, replace with useful ones
* Combine event rejection and persistence in a single function
* Additional safety assertions in upgrade task
* Split upgrade task into multiple subroutines for reduced cognitive complexity
* Only mutate current state and forward extremities in tandem
* Improve code documentation to better explain the logic flow
2026-07-11 17:27:42 +01:00