refactor: Switch to upstream Ruma #1656
No reviewers
Labels
No labels
Blocked
Bug
Changelog
Added
Changelog
Missing
Changelog
None
Cherry-picking
Database
Dependencies
Dependencies/Renovate
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/E2EE
Matrix/Federation
Matrix/Hydra
Matrix/MSC
Matrix/Media
Matrix/T&S
Merge
Merge/Manual
Merge/Squash
Meta
Meta/CI
Meta/Packaging
Priority
Blocking
Priority
High
Priority
Low
Security
Status
Confirmed
Status
Duplicate
Status
Invalid
Status
Needs Investigation
Support
Wont fix
old/ci/cd
old/rust
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Blocks
#1487 feat: Update policy server implementation to match latest spec
continuwuation/continuwuity
Reference
continuwuation/continuwuity!1656
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "ginger/ruma-upstreaming"
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 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:
mainbranch, and the branch is named something other thanmain.myself, if applicable. This includes ensuring code compiles.
api/client/account/481c4bb399api/client/membership/652597f696api/client/room/31d2751f5capi/client/sync7c9ab2a4feapi/client/account_data.rs9f8209f9efapi/client/appservice.rsa75b805691api/client/backup.rs66072c9cf7api/client/capabilities.rsfa20cfa247api/client/context.rs9a00e2c30eapi/client/dehydrated_device.rs5a4bcfbd1eapi/client/device.rs03e4a8cc0dapi/client/directory.rsb4b343f057api/client/keys.rsd8bea25ed9api/client/media_legacy.rs56bbad650eapi/client/media.rs9b448db40capi/client/messages.rscafe6ca318api/client/openid.rs63bb96648aapi/client/presence.rsf04d1b4924api/client/profile.rsandapi/client/unstable.rs4f3bcef52fapi/client/push.rs1d589ba8b5api/client/read_marker.rscf225f473fapi/client/redact.rs3435524ec9api/client/relations.rs9958ad9ed8api/client/report.rsebcba065cfapi/client/search.rsad21c26bc2api/client/send.rsbed9098196api/client/session.rs8572f4c99bapi/client/state.rs12be07e15capi/client/tag.rs803bdb0cc3api/client/thirdparty.rs35acbb10bfapi/client/threads.rscda88eced0api/client/to_device.rs0a64abbb58api/client/typing.rsea3c90746dapi/client/unversioned.rs2a34f40c06api/client/user_directory.rs815bfa1ed4api/client/voip.rs5c9675299eapi/client/well_known.rs5fabbfb6ecapi/client/sync/v3/mod.rs83918e3531api/cient/message.rs0143a4d479api/server/backfill.rs301ae16891api/server/event_auth.rsa07822cf3aapi/server/event.rs287b8b5fd9api/server/get_missing_events.rs8c4ac0eefbapi/server/invite.rsadb00e4b81api/server/key.rs2f0ceeefa2api/server/make_join.rsa3d9b8e1c9api/server/make_knock.rs57eeee4b34api/server/make_leave.rs8118a1b69capi/server/media.rs5ebed3a650api/server/publicrooms.rs6ec38cac03api/server/query.rse67b5fade2api/server/send_join.rsbd1046cbbbapi/server/send_knock.rse79e0cbf9dapi/server/send_leave.rs638cc0e037api/server/send.rs7a8a07e55fapi/server/state_ids.rs2887f340c9api/server/state.rs188d8b3a1bapi/server/user.rs6b6243ba1dapi/server/version.rsb11e91c47aapi/server/well_known.rs4c63baea0eapi/router/068196ac22web/9dd2911649api/(and temporarily switch to a fork of ruma) 1c7bc292f9admin/check/commands.rsd4469af359admin/debug/commands.rs76b06afa19admin/federation/commands.rsf2ec8ca672admin/media/commands.rs3356655f85admin/query/f78362cab8admin/room/e8c9085839admin/user/22a8b3e66dadmin/processor.rs99b09e062bapi/client/directory.rs, again 6a75755a65refactor: Switch to upstream Rumato WIP: refactor: Switch to upstream RumaBlocked on upstream merging some PRs. For now this uses my own fork of ruma.
preliminary comments
@ -242,3 +235,1 @@"Tried to change an existing master key, UIA required")));}return Err!(Request(Forbidden(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(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(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;it'd make more sense to just create a new RoomMemberEventContent here, the only fields we want for a ban are
membership,reason, andredact_events(MSC4293)@ -36,0 +40,4 @@content.is_direct = None;content.join_authorized_via_users_server = None;content.third_party_invite = None;// TODO(upstream): MSC4293MSC4293 is an important T&S feature we actively use, I don't think we can merge this until support is upstreamed
This is blocked on your own PR 🧌
I know, just saying
@ -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"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;Same thing as for ban. Also, MSC4293 will need adding here, it was missed in the ruwuma impl
@ -0,0 +5,4 @@use crate::Ruma;/// # `GET /_matrix/client/unstable/uk.half-shot.msc2666/user/mutual_rooms`This endpoint is stable now
That's a matter for upstream, they haven't added the stable version yet
lmao what
@ -249,0 +112,4 @@};// Update our local copies of their profile fieldsservices.users.clear_profile(user_id).await;Should probably only do this if there's actually a difference
I don't think checking that will provide a meaningful performance boost
@ -249,0 +121,4 @@};set_profile_field(services, user_id, ProfileFieldChange::Set(value)).await;}Needs to make sure the total profile in canonical representation does not exceed 64KiB
@ -249,0 +156,4 @@if let Ok(value) = ProfileFieldValue::new(field.as_str(), value) {set_profile_field(services, user_id, ProfileFieldChange::Set(value.clone())).await;Ok(Some(value))Needs to make sure the total profile in canonical representation does not exceed 64KiB
@ -266,0 +252,4 @@}}async fn set_profile_field(services: &Services, user_id: &UserId, change: ProfileFieldChange) {This function needs bounds checking really. Individual fields shouldn't be more than 64KiB and the entire profile shouldn't either
@ -41,2 +39,2 @@reason: body.reason.clone(),})..PartialPdu::timeline(&assign!(RoomRedactionEventContent::new_v11(body.event_id.clone()), {uhhh
new_v11? What about other room versions?new_v11sets theredactsfield in the content, as opposed tonew_v1which doesn't. We set bothredacts-in-content andredacts-in-PDU for all room versions.@ -145,3 +140,3 @@}if body.reason.as_ref().is_some_and(|s| s.len() > 750) {if body.reason.len() > 750 {Can we drop this arbitrary limit? or raise it to something sensible like 2000?
@ -201,3 +195,3 @@}if reason.as_ref().is_some_and(|s| s.len() > 750) {if reason.len() > 750 {same as prior
@ -444,3 +461,3 @@debug_warn!("skipping empty initial state event with content of `{{}}`: {event:?}");debug_warn!("content: {}", pdu_builder.content.get());debug_warn!("content: {}", partial_pdu.content.get());continue;Wait, we're not supposed to do this per the spec, why do we do this at all? This if statement should be dropped
@ -91,2 +89,2 @@} else {Nonelet room_id: Option<OwnedRoomId> = match room_version_rules.room_id_format {| RoomIdFormatVersion::V1 => Some(RoomId::new_v1(services.globals.server_name())),Can we not drop the custom room ID stuff? That's like one of the coolest features conduwuit had and it'd be a shame to see it go
@ -245,1 +269,3 @@membership: MembershipState::Join,PartialPdu::state(sender_user.as_str(),&assign!(RoomMemberEventContent::new(MembershipState::Join), {Nit: maybe clone the invoking user's membership content in the tombstoned room to the new one? not sure if it's worth it
I don't think that's necessary
@ -0,0 +19,4 @@rate_limited: false,authentication: AccessToken,history: {unstable => "/_matrix/client/unstable/uk.timedout.msc4323/admin/suspend/{user_id}",This is stable in v1.18 now ->
/_matrix/client/v1/admin/suspend/{userId}@ -0,0 +19,4 @@rate_limited: false,authentication: AccessToken,history: {unstable => "/_matrix/client/unstable/uk.timedout.msc4323/admin/suspend/{user_id}",Stable in v1.18 ->
/_matrix/client/v1/admin/suspend/{userId}@ -0,0 +1,271 @@//! Types for invite filtering ([MSC4155]).Does this not want upstreaming?
@ -0,0 +1,91 @@//! Types for the [`org.matrix.msc4284.policy`] event.No point migrating this, once this PR is merged I'll rebase #1487 on it and use upstreamed structs
no no nvm you'll need it in order to merge current code lmao
@ -0,0 +1,58 @@//! `GET /_matrix/federation/*/rooms/{roomId}/report/{eventId}`We support this?
I don't know if we use the route, but it was in ruwuma, so I copied it to ruminuwuity
you can probably drop it i dont think we support that
@ -165,0 +218,4 @@let power_levels_event: RoomPowerLevelsEventContent = self.room_state_get_content(room_id, &StateEventType::RoomPowerLevels, "").await.unwrap_or_else(|_| {This silently swallows deserialisation errors doesn't it? That's probably bad
finished reviewing now
7eededadfed20707533acabd559ae2to5add5b6a135add5b6a1358b716e264WIP: refactor: Switch to upstream Rumato refactor: Switch to upstream Ruma58b716e264561a7dccd39168eb1ed77b99757337blocking until bugs fixed. Found so far: appservice puppeting broken, creating a v12 room seemingly fails (see maintainer room for more info)
Let me OUT
require_auth_for_profile_requests#1792