-
Notifications
You must be signed in to change notification settings - Fork 327
feat(sdk): Spaces #5509
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat(sdk): Spaces #5509
Conversation
655477a
to
f52ebdb
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #5509 +/- ##
==========================================
+ Coverage 88.57% 88.62% +0.04%
==========================================
Files 340 344 +4
Lines 93690 94382 +692
Branches 93690 94382 +692
==========================================
+ Hits 82989 83642 +653
- Misses 6568 6599 +31
- Partials 4133 4141 +8 ☔ View full report in Codecov by Sentry. |
CodSpeed Performance ReportMerging #5509 will not alter performanceComparing Summary
Benchmarks breakdown
|
eab6c0c
to
0b14496
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First fast review. Keep going!
5024faa
to
a2a4ef8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aff6435
to
8dc94da
Compare
8dc94da
to
2e0ed68
Compare
cde1a3d
to
e761648
Compare
Something weird is going on with the latest version, all of my There's a branch here if you want to test the updates with diffing: |
e761648
to
6f0c641
Compare
Went ahead and fixed the remaining issues with VectorDiffs, seems fine now on your branch. Thanks for testing! |
…d `sync_events` to the `EventFactory`
…provides reactive interfaces to its rooms and pagination state
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've reviewed up to the graph thingy. Is it possible to squash commits that are updating the same part of the code, they are mostly fixup at this point and it would simplifiy the review process.
I'm also wondering if using Client::rooms_stream
could remove the need for some tasks, what do you think?
println!("Top level children for space {}: {:?}", space_id, result.rooms); | ||
|
||
Ok(vec![]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a debug code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is, with this being the initial commit. I'm happy to squash these if you think evolution history isn't relevant.
let ok = if let Ok(parents) = room.parent_spaces().await { | ||
pin_mut!(parents); | ||
parents.any(|p| p.is_ok()).await == false | ||
} else { | ||
false | ||
}; | ||
(room, ok) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are you trying to do here? The ok
refers to the “back-link”, like a space has a link to the room (from parent to child), and the room has a link to the space (from child to parent)?
I think it deserves a log when the child has no link to the parent, it's an important information.
Also, to remove the need to use tokio_stream
, you can do:
let mut top_level_spaces = Vec::new();
for room in joined_spaces {
if let Ok(parents) = room.parent_spaces().await {
// do checks
if everything_is_alright {
top_level_spaces.push(room);
}
} else {
warn!("…");
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was trying to figure out what the top level parent spaces are, the spaces that don't have any parents of their own. It turned out to be the wrong approach as child to parent or parent to child relations aren't enforced so it can result in wrong results. It was replaced with a proper graph structure that fills in missing edges in b2ea99c
5bd6464
to
9a4893e
Compare
…states change i.e. they get joined or left.
…ted uniffi version - automatic Arc inference was introduced in 0.27 and complement is using 0.25
…state events in the sliding sync required state as they're both required to build a full view of the space room hierarchy
9a4893e
to
938a278
Compare
…tions to correctly detect all the edges and be able to remove any cycles. - cycle removing is done through DFS and keeping a list of visited nodes
…ceServiceRoomList::paginate`
…ption methods so it can be retained on the client side
…alls so only the direct children are fetche
…` responses and `SpaceServiceRoomList` instances
…tead automatically setup a client subscription when requesting the joined services subscription
…d components on both the UI and the FFI crates
…ned spaces and space room list subscriptions
…ting up a subscription - fixes values being reported only after the first sync update
938a278
to
0ae963c
Compare
…e it within the space service to reduce the number of iterations required
This series of patches introduces a top level UI oriented interface for interacting with spaces.
The
SpaceService
offers:joined_spaces
and asubscribe_to_joined_spaces
stream that automatically updates based on client activitym.space.parent
andm.space.children
state events it knows about, removing cycles and then only keeping parent spacesSpaceRoomList
that can be used to interact with the rooms hierarchy endpoint and retrieve rooms referencing a certain parentsubscribe_to_room_updates
publisher (e.g. when joining one of the rooms)I do appreciate this is a pretty chunky PR but it should be straight forward to review commit by commit.