feat: Upload files for admin commands that are too long #902
No reviewers
Labels
No labels
Bug
Cherry-picking
Database
Dependencies
Difficulty
Easy
Difficulty
Hard
Difficulty
Medium
Documentation
Enhancement
Good first issue
Help wanted
Inherited
Matrix/Administration
Matrix/Appservices
Matrix/Auth
Matrix/Client
Matrix/Core
Matrix/Federation
Matrix/MSC
Matrix/Media
Meta
Meta/Packaging
Priority
Blocking
Priority
High
Priority
Low
Security
Status
Confirmed
Status
Duplicate
Status
Invalid
Status
Needs Investigation
Wont fix
old/ci/cd
old/rust
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: continuwuation/continuwuity#902
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "nex/feat/admin-command-files"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.
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.
@ -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) => {
clippy or cargo fmt did this, not sure why - can remove from PR if needed
It's fine