fix: V12 room upgrades #1067

Merged
Jade merged 2 commits from nex/fix/upgrade into main 2025-09-25 08:15:23 +00:00
Owner

allows the /upgrade endpoint (and client commands) to upgrade to v12 rooms kinda

allows the /upgrade endpoint (and client commands) to upgrade to v12 rooms kinda
fix: V12 room upgrades
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Successful in 30s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m13s
Release Docker Image / Build linux-arm64 (release) (pull_request) Successful in 6m16s
Release Docker Image / Build linux-amd64 (release) (pull_request) Successful in 6m34s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 8m3s
Release Docker Image / Create Multi-arch Release Manifest (pull_request) Successful in 11s
Release Docker Image / Build linux-amd64 (max-perf) (pull_request) Successful in 14m54s
Release Docker Image / Build linux-arm64 (max-perf) (pull_request) Successful in 14m4s
Release Docker Image / Create Max-Perf Manifest (pull_request) Successful in 17s
6137cced3b
@ -100,2 +89,2 @@
drop(state_lock);
let state_lock = services.rooms.state.mutex.lock(&replacement_room).await;
let tombstone_event_id = if room_features.room_ids_as_hashes {
None
Owner

This is the thing that's missing right?

This is the thing that's missing right?
Author
Owner

yeah it previously just forced a new room ID which makes v12 rooms sad because the room Id changedf to the create event id

yeah it previously just forced a new room ID which makes v12 rooms sad because the room Id changedf to the create event id
Owner

logic probs needs to look like

  • check perms to sent tombstone event
  • actually make the room
  • send tombstone event

except there's a cyclic dep between tombstone and new room with v12 if we want to link the latest event in the tombstone, and I can't remember what the solution to this was lol

logic probs needs to look like - check perms to sent tombstone event - actually make the room - send tombstone event except there's a cyclic dep between tombstone and new room with v12 if we want to link the latest event in the tombstone, and I can't remember what the solution to this was lol
Author
Owner

v12 explicitly breaks the previous cyclic thingy by dropping the event reference entirely

v12 explicitly breaks the previous cyclic thingy by dropping the event reference entirely
nex force-pushed nex/fix/upgrade from 6137cced3b
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Successful in 30s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m13s
Release Docker Image / Build linux-arm64 (release) (pull_request) Successful in 6m16s
Release Docker Image / Build linux-amd64 (release) (pull_request) Successful in 6m34s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 8m3s
Release Docker Image / Create Multi-arch Release Manifest (pull_request) Successful in 11s
Release Docker Image / Build linux-amd64 (max-perf) (pull_request) Successful in 14m54s
Release Docker Image / Build linux-arm64 (max-perf) (pull_request) Successful in 14m4s
Release Docker Image / Create Max-Perf Manifest (pull_request) Successful in 17s
to e2a2aef7be
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Successful in 29s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 54s
Release Docker Image / Build linux-amd64 (release) (pull_request) Successful in 5m33s
Release Docker Image / Build linux-arm64 (release) (pull_request) Successful in 6m22s
Release Docker Image / Create Multi-arch Release Manifest (pull_request) Successful in 19s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 8m32s
Release Docker Image / Build linux-amd64 (max-perf) (pull_request) Successful in 23m27s
Release Docker Image / Build linux-arm64 (max-perf) (pull_request) Successful in 24m48s
Release Docker Image / Create Max-Perf Manifest (pull_request) Successful in 11s
2025-09-22 19:51:54 +00:00
Compare
nex requested review from Owners 2025-09-22 19:59:57 +00:00
Owner

Are we OK with just not sending tombstones for now then?

Are we OK with just not sending tombstones for now then?
Author
Owner

no i forgor

no i forgor
nex removed review request for Owners 2025-09-22 20:04:51 +00:00
Owner

also CI clippy is being odd but local clippy says:

warning: using `clone` on type `Option<&RoomId>` which implements the `Copy` trait
   --> src/api/client/room/upgrade.rs:102:24
    |
102 |                     replacement_room: replacement_room.clone().unwrap().to_owned(),
    |                                       ^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `replacement_room`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
    = note: `-W clippy::clone-on-copy` implied by `-W clippy::complexity`
    = help: to override `-W clippy::complexity` add `#[allow(clippy::clone_on_copy)]`

warning: `conduwuit_api` (lib) generated 1 warning (run `cargo clippy --fix --lib -p conduwuit_api` to apply 1 suggestion)
also CI clippy is being odd but local clippy says: ``` warning: using `clone` on type `Option<&RoomId>` which implements the `Copy` trait --> src/api/client/room/upgrade.rs:102:24 | 102 | replacement_room: replacement_room.clone().unwrap().to_owned(), | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `replacement_room` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy = note: `-W clippy::clone-on-copy` implied by `-W clippy::complexity` = help: to override `-W clippy::complexity` add `#[allow(clippy::clone_on_copy)]` warning: `conduwuit_api` (lib) generated 1 warning (run `cargo clippy --fix --lib -p conduwuit_api` to apply 1 suggestion) ```
fix(v12): Create tombstone event on room upgrade
Some checks failed
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m32s
Documentation / Build and Deploy Documentation (pull_request) Successful in 3m25s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 7m32s
Release Docker Image / Build linux-amd64 (release) (pull_request) Successful in 7m32s
Release Docker Image / Build linux-arm64 (release) (pull_request) Successful in 7m37s
Release Docker Image / Create Multi-arch Release Manifest (pull_request) Successful in 9s
Release Docker Image / Build linux-amd64 (max-perf) (pull_request) Successful in 12m53s
Release Docker Image / Build linux-arm64 (max-perf) (pull_request) Successful in 12m48s
Release Docker Image / Create Max-Perf Manifest (pull_request) Successful in 9s
03c29e19cb
Owner

Does that look good to you?

Does that look good to you?
Jade requested review from Owners 2025-09-23 20:56:23 +00:00
Author
Owner

lgtm, you might wanna run clippy though

lgtm, you might wanna run clippy though
Owner

I feel like the clippy cache might be poisoned somehow lol

I feel like the clippy cache might be poisoned somehow lol
nex force-pushed nex/fix/upgrade from 03c29e19cb
Some checks failed
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m32s
Documentation / Build and Deploy Documentation (pull_request) Successful in 3m25s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 7m32s
Release Docker Image / Build linux-amd64 (release) (pull_request) Successful in 7m32s
Release Docker Image / Build linux-arm64 (release) (pull_request) Successful in 7m37s
Release Docker Image / Create Multi-arch Release Manifest (pull_request) Successful in 9s
Release Docker Image / Build linux-amd64 (max-perf) (pull_request) Successful in 12m53s
Release Docker Image / Build linux-arm64 (max-perf) (pull_request) Successful in 12m48s
Release Docker Image / Create Max-Perf Manifest (pull_request) Successful in 9s
to 9d0c89bd04
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Successful in 54s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m44s
Release Docker Image / Build linux-amd64 (release) (pull_request) Successful in 5m35s
Release Docker Image / Build linux-arm64 (release) (pull_request) Successful in 5m47s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 6m49s
Release Docker Image / Create Multi-arch Release Manifest (pull_request) Successful in 10s
Release Docker Image / Build linux-amd64 (max-perf) (pull_request) Successful in 12m23s
Release Docker Image / Build linux-arm64 (max-perf) (pull_request) Successful in 12m19s
Release Docker Image / Create Max-Perf Manifest (pull_request) Successful in 9s
2025-09-24 18:22:18 +00:00
Compare
nex added this to the 0.5.0 milestone 2025-09-25 02:11:43 +00:00
Jade merged commit ef84e1bb02 into main 2025-09-25 08:15:23 +00:00
Sign in to join this conversation.
No reviewers
continuwuation/Owners
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!1067
No description provided.