WIP: refactor: Switch to upstream Ruma #1656

Draft
ginger wants to merge 90 commits from ginger/ruma-upstreaming into main
Owner

This pull request switches from https://forgejo.ellis.link/continuwuation/ruwuma to upstream Ruma, reducing code rot and allowing us to use upstream features missing from ruwuma.

Pull request checklist:

  • This pull request targets the main branch, and the branch is named something other than
    main.
  • I have written an appropriate pull request title and my description is clear.
  • I understand I am responsible for the contents of this pull request.
  • I have followed the contributing guidelines:
<!-- In order to help reviewers know what your pull request does at a glance, you should ensure that 1. Your PR title is a short, single sentence describing what you changed 2. You have described in more detail what you have changed, why you have changed it, what the intended effect is, and why you think this will be beneficial to the project. If you have made any potentially strange/questionable design choices, but didn't feel they'd benefit from code comments, please don't mention them here - after opening your pull request, go to "files changed", and click on the "+" symbol in the line number gutter, and attach comments to the lines that you think would benefit from some clarification. --> This pull request switches from https://forgejo.ellis.link/continuwuation/ruwuma to upstream Ruma, reducing code rot and allowing us to use upstream features missing from ruwuma. <!-- Example: This pull request allows us to warp through time and space ten times faster than before by double-inverting the warp drive with hyperheated jump fluid, both making the drive faster and more efficient. This resolves the common issue where we have to wait more than 10 milliseconds to engage, use, and disengage the warp drive when travelling between galaxies. --> <!-- Closes: #... --> <!-- Fixes: #... --> <!-- Uncomment the above line(s) if your pull request fixes an issue or closes another pull request by superseding it. Replace `#...` with the issue/pr number, such as `#123`. --> **Pull request checklist:** <!-- You need to complete these before your PR can be considered. If you aren't sure about some, feel free to ask for clarification in #dev:continuwuity.org. --> - [x] This pull request targets the `main` branch, and the branch is named something other than `main`. - [x] I have written an appropriate pull request title and my description is clear. - [x] I understand I am responsible for the contents of this pull request. - I have followed the [contributing guidelines][c1]: - [x] My contribution follows the [code style][c2], if applicable. - [x] I ran [pre-commit checks][c1pc] before opening/drafting this pull request. - [x] I have [tested my contribution][c1t] (or proof-read it for documentation-only changes) myself, if applicable. This includes ensuring code compiles. - [x] My commit messages follow the [commit message format][c1cm] and are descriptive. - [ ] I have written a [news fragment][n1] for this PR, if applicable<!--(can be done after hitting open!)-->. <!-- Notes on these requirements: - While not required, we encourage you to sign your commits with GPG or SSH to attest the authenticity of your changes. - While we allow LLM-assisted contributions, we do not appreciate contributions that are low quality, which is typical of machine-generated contributions that have not had a lot of love and care from a human. Please do not open a PR if all you have done is asked ChatGPT to tidy up the codebase with a +-100,000 diff. - In the case of code style violations, reviewers may leave review comments/change requests indicating what the ideal change would look like. For example, a reviewer may suggest you lower a log level, or use `match` instead of `if/else` etc. - In the case of code style violations, pre-commit check failures, minor things like typos/spelling errors, and in some cases commit format violations, reviewers may modify your branch directly, typically by making changes and adding a commit. Particularly in the latter case, a reviewer may rebase your commits to squash "spammy" ones (like "fix", "fix", "actually fix"), and reword commit messages that don't satisfy the format. - Pull requests MUST pass the `Checks` CI workflows to be capable of being merged. This can only be bypassed in exceptional circumstances. If your CI flakes, let us know in matrix:r/dev:continuwuity.org. - Pull requests have to be based on the latest `main` commit before being merged. If the main branch changes while you're making your changes, you should make sure you rebase on main before opening a PR. Your branch will be rebased on main before it is merged if it has fallen behind. - We typically only do fast-forward merges, so your entire commit log will be included. Once in main, it's difficult to get out cleanly, so put on your best dress, smile for the cameras! --> [c1]: https://forgejo.ellis.link/continuwuation/continuwuity/src/branch/main/CONTRIBUTING.md [c2]: https://forgejo.ellis.link/continuwuation/continuwuity/src/branch/main/docs/development/code_style.mdx [c1pc]: https://forgejo.ellis.link/continuwuation/continuwuity/src/branch/main/CONTRIBUTING.md#pre-commit-checks [c1t]: https://forgejo.ellis.link/continuwuation/continuwuity/src/branch/main/CONTRIBUTING.md#running-tests-locally [c1cm]: https://forgejo.ellis.link/continuwuation/continuwuity/src/branch/main/CONTRIBUTING.md#commit-messages [n1]: https://towncrier.readthedocs.io/en/stable/tutorial.html#creating-news-fragments
Co-authored-by: Jade Ellis <jade@ellis.link>
Sent from my Steam Deck
chore: Clippy fixes
Some checks failed
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m26s
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m54s
Checks / Changelog / Check changelog is added (pull_request_target) Failing after 9s
Documentation / Build and Deploy Documentation (pull_request) Successful in 5m22s
Deploy Element Web / 🏗️ Build and Deploy (pull_request) Successful in 8m59s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 9m47s
2497a959c9
ginger changed title from refactor: Switch to upstream Ruma to WIP: refactor: Switch to upstream Ruma 2026-04-13 22:39:30 +00:00
Author
Owner

Blocked on upstream merging some PRs. For now this uses my own fork of ruma.

Blocked on upstream merging some PRs. For now this uses my own fork of ruma.
chore: Changelog
Some checks failed
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 32s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m19s
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m56s
Documentation / Build and Deploy Documentation (pull_request) Successful in 4m31s
Deploy Element Web / 🏗️ Build and Deploy (pull_request) Successful in 7m54s
Checks / Prek / Clippy and Cargo Tests (pull_request) Has been cancelled
1ed620c524
fix: Fix failing test
All checks were successful
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 34s
Documentation / Build and Deploy Documentation (pull_request) Successful in 1m14s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 2m36s
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m59s
Deploy Element Web / 🏗️ Build and Deploy (pull_request) Successful in 8m1s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 10m16s
2b0b3669fc
refactor: Improve summary service logging
All checks were successful
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 8s
Documentation / Build and Deploy Documentation (pull_request) Successful in 1m14s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m24s
Deploy Element Web / 🏗️ Build and Deploy (pull_request) Successful in 8m8s
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m49s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 8m12s
e8967c43bb
nex requested changes 2026-04-14 15:00:16 +00:00
nex left a comment
Owner

preliminary comments

preliminary comments
@ -242,3 +235,1 @@
"Tried to change an existing master key, UIA required"
)));
}
return Err!(Request(Forbidden(
Owner

UIA is supposed to be skipped if the keys are also the same, not just if it's new

UIA is supposed to be skipped if the keys are also the same, not just if it's new
@ -258,3 +248,1 @@
"Tried to change an existing user signing key, UIA required"
)));
}
return Err!(Request(Forbidden(
Owner

UIA is supposed to be skipped if the keys are also the same, not just if it's new

UIA is supposed to be skipped if the keys are also the same, not just if it's new
@ -278,3 +265,1 @@
"Tried to update an existing self signing key, UIA required"
)));
}
return Err!(Request(Forbidden(
Owner

UIA is supposed to be skipped if the keys are also the same, not just if it's new

UIA is supposed to be skipped if the keys are also the same, not just if it's new
@ -33,3 +33,4 @@
.await
.unwrap_or_else(|_| RoomMemberEventContent::new(MembershipState::Ban));
content.membership = MembershipState::Ban;
Owner

it'd make more sense to just create a new RoomMemberEventContent here, the only fields we want for a ban are membership, reason, and redact_events (MSC4293)

it'd make more sense to just create a new RoomMemberEventContent here, the only fields we want for a ban are `membership`, `reason`, and `redact_events` (MSC4293)
@ -36,0 +40,4 @@
content.is_direct = None;
content.join_authorized_via_users_server = None;
content.third_party_invite = None;
// TODO(upstream): MSC4293
Owner

MSC4293 is an important T&S feature we actively use, I don't think we can merge this until support is upstreamed

MSC4293 is an important T&S feature we actively use, I don't think we can merge this until support is upstreamed
Author
Owner

This is blocked on your own PR 🧌

This is blocked on [your own PR](https://github.com/ruma/ruma/pull/2453) 🧌
@ -389,3 +384,3 @@
// How did we get here?
return Err!(BadServerResponse(
"Remote room version {room_version_id} is not supported by conduwuit"
"Remote room version {room_version} is not supported by conduwuit"
Owner

conduwuit -> continuwuity

conduwuit -> continuwuity
@ -44,0 +42,4 @@
event.reason.clone_from(&body.reason);
event.is_direct = None;
event.join_authorized_via_users_server = None;
event.third_party_invite = None;
Owner

Same thing as for ban. Also, MSC4293 will need adding here, it was missed in the ruwuma impl

Same thing as for ban. Also, MSC4293 will need adding here, it was missed in the ruwuma impl
fix: Enable compatibility feature to fix federation with old conduit-family homeservers
All checks were successful
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 34s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m21s
Documentation / Build and Deploy Documentation (pull_request) Successful in 1m32s
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m59s
Deploy Element Web / 🏗️ Build and Deploy (pull_request) Successful in 8m6s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 11m36s
7eededadfe
All checks were successful
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 34s
Required
Details
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m21s
Required
Details
Documentation / Build and Deploy Documentation (pull_request) Successful in 1m32s
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m59s
Deploy Element Web / 🏗️ Build and Deploy (pull_request) Successful in 8m6s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 11m36s
Required
Details
This pull request has changes conflicting with the target branch.
  • Cargo.lock
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin ginger/ruma-upstreaming:ginger/ruma-upstreaming
git switch ginger/ruma-upstreaming
Sign in to join this conversation.
No reviewers
nex
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!1656
No description provided.