feat: Upload files for admin commands that are too long #902

Merged
nex merged 2 commits from nex/feat/admin-command-files into main 2025-07-09 14:33:10 +00:00
Owner

This closes #304 by uploading a markdown file when the generated output is too large.

It does this by checking if the expected output size would exceed 60KiB (allowing for a 4KiB wiggle room for the rest of the PDU fluff) and if so, converting the output to a file and sending that instead.

image

This technically has some edge-cases where the content size might be under 60KiB, but the PDU size grows to over 64KiB, causing the error again, but I can't think of a way to easily reproduce that, and handing those cases is more work than doing this.

This closes #304 by uploading a markdown file when the generated output is too large. It does this by checking if the expected output size would exceed 60KiB (allowing for a 4KiB wiggle room for the rest of the PDU fluff) and if so, converting the output to a file and sending that instead. ![image](/attachments/d8bb7e22-f1c2-4465-9845-be811c43c336) This *technically* has some edge-cases where the content size might be under 60KiB, but the PDU size grows to over 64KiB, causing the error again, but I can't think of a way to easily reproduce that, and handing those cases is more work than doing this.
nex added the
Enhancement
Matrix/Administration
labels 2025-07-09 14:13:09 +00:00
nex added 1 commit 2025-07-09 14:13:09 +00:00
feat(902): Upload files for admin commands that are too long
Some checks failed
Release Docker Image / merge (push) Blocked by required conditions
Release Docker Image / define-variables (push) Successful in 2s
Checks / Prefligit / prefligit (push) Successful in 34s
Checks / Rust / Format (push) Successful in 38s
Documentation / Build and Deploy Documentation (pull_request) Successful in 38s
Checks / Rust / Cargo Test (push) Failing after 1m16s
Checks / Prefligit / prefligit (pull_request) Successful in 19s
Checks / Rust / Clippy (push) Failing after 2m27s
Release Docker Image / build-image (linux/amd64, release, linux-amd64, base) (push) Successful in 10m9s
Release Docker Image / build-image (linux/arm64, release, linux-arm64, base) (push) Has been cancelled
7b60f5368d
requested reviews from Jade, Owners 2025-07-09 14:16:00 +00:00
nex reviewed 2025-07-09 14:17:20 +00:00
@ -194,3 +194,2 @@
| Ok(event) if !matches!(event.membership, Invite | Knock | Join) =>
return Err!("Cannot revoke {user_id} in membership state {:?}.", event.membership),
| Ok(event) if !matches!(event.membership, Invite | Knock | Join) => {
Author
Owner

clippy or cargo fmt did this, not sure why - can remove from PR if needed

clippy or cargo fmt did this, not sure why - can remove from PR if needed
Owner

It's fine

It's fine
Jade marked this conversation as resolved
Jade approved these changes 2025-07-09 14:20:25 +00:00
nex added 1 commit 2025-07-09 14:28:41 +00:00
style(902): Fix clippy complaining about cast
All checks were successful
Documentation / Build and Deploy Documentation (pull_request) Successful in 37s
Checks / Prefligit / prefligit (pull_request) Successful in 22s
Release Docker Image / define-variables (push) Successful in 7s
Checks / Prefligit / prefligit (push) Successful in 20s
Documentation / Build and Deploy Documentation (push) Successful in 43s
Checks / Rust / Format (push) Successful in 55s
Checks / Rust / Clippy (push) Successful in 4m26s
Checks / Rust / Cargo Test (push) Successful in 5m12s
Release Docker Image / build-image (linux/amd64, release, linux-amd64, base) (push) Successful in 13m43s
Release Docker Image / build-image (linux/arm64, release, linux-arm64, base) (push) Successful in 12m18s
Release Docker Image / merge (push) Successful in 26s
ce84c46459
nex scheduled this pull request to auto merge when all checks succeed 2025-07-09 14:29:23 +00:00
nex merged commit ce84c46459 into main 2025-07-09 14:33:10 +00:00
nex deleted branch nex/feat/admin-command-files 2025-07-09 14:33:11 +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#902
No description provided.