Skip to content

Conversation

@pixlwave
Copy link
Member

@pixlwave pixlwave commented Nov 14, 2025

This PR makes 2 changes

  • Add SpaceService::add_child_to_space and SpaceService::remove_child_from_space to allow for spaces to be edited.
  • Add SpaceService::joined_parents_of_child to allow the editing of spaces from a room/subspace context (and for setting join rules).

Closes #5821

@codecov
Copy link

codecov bot commented Nov 14, 2025

Codecov Report

❌ Patch coverage is 83.72093% with 42 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.59%. Comparing base (9ab886f) to head (f9e04f8).
⚠️ Report is 51 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
crates/matrix-sdk-ui/src/spaces/mod.rs 81.65% 33 Missing and 9 partials ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##             main    #5871    +/-   ##
========================================
  Coverage   88.59%   88.59%            
========================================
  Files         363      363            
  Lines      102888   103144   +256     
  Branches   102888   103144   +256     
========================================
+ Hits        91153    91382   +229     
- Misses       7496     7513    +17     
- Partials     4239     4249    +10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@codspeed-hq
Copy link

codspeed-hq bot commented Nov 14, 2025

CodSpeed Performance Report

Merging #5871 will not alter performance

Comparing doug/space-children (f9e04f8) with main (2f7d2b3)

Summary

✅ 50 untouched

@pixlwave pixlwave force-pushed the doug/space-children branch 4 times, most recently from 6e626f8 to a78df15 Compare November 20, 2025 12:28
@pixlwave pixlwave marked this pull request as ready for review November 20, 2025 12:40
@pixlwave pixlwave requested a review from a team as a code owner November 20, 2025 12:40
@pixlwave pixlwave requested review from stefanceriu and removed request for a team November 20, 2025 12:40
server.sync_room(client, builder).await;
}
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should move the tests to a different file 🤔

.await
.map_err(Error::UpdateRelationship)?;
} else {
warn!("The current user doesn't have permission to set the child's parent.");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should really bubble this error up or maybe or maybe add a parameter to have the client tell us what they expect?

Copy link
Member Author

@pixlwave pixlwave Nov 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We discussed this. It's hard to know what the caller would expect with a single method, so for now we'll leave it as is. In the future we'll potentially add some parameters and can throw based on those.

let space_service = SpaceService::new(client.clone());

// Wait for the space hierarchy to register.
_ = space_service.joined_spaces().await;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we just move the subscription logic to a separate setup method? That's what I did for the new GroupedRoomList service and honestly I don't have a better idea at the moment 🤔

Copy link
Member Author

@pixlwave pixlwave Nov 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That sounds fair, but I think I'll leave that exercise to you (or me in the next PR if I need it for sharing the graph logic).

@pixlwave pixlwave force-pushed the doug/space-children branch from a78df15 to f9e04f8 Compare November 24, 2025 12:40
@stefanceriu stefanceriu self-requested a review November 24, 2025 12:52
Copy link
Member

@stefanceriu stefanceriu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks for the changes, it all looks good to me now 👍

@stefanceriu stefanceriu enabled auto-merge (rebase) November 24, 2025 12:55
@stefanceriu stefanceriu merged commit f49c588 into main Nov 24, 2025
52 checks passed
@stefanceriu stefanceriu deleted the doug/space-children branch November 24, 2025 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Task] FFI: Add the ability to query and set the parents of a Room.

3 participants