feat(sdk): Add creation of indexes and indexing of messages#5505
feat(sdk): Add creation of indexes and indexing of messages#5505
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #5505 +/- ##
==========================================
+ Coverage 88.57% 88.58% +0.01%
==========================================
Files 339 339
Lines 93627 93649 +22
Branches 93627 93649 +22
==========================================
+ Hits 82927 82957 +30
+ Misses 6565 6558 -7
+ Partials 4135 4134 -1 ☔ View full report in Codecov by Sentry. |
CodSpeed Performance ReportMerging #5505 will not alter performanceComparing Summary
|
d771525 to
815f511
Compare
|
Handing to @poljar as I think you are looking after this. If this is just a standard review, feel free to hand it back to me. |
8c7da74 to
7d21856
Compare
bnjbvr
left a comment
There was a problem hiding this comment.
Sweet, excited to see this integration happen 🥳
I've got a few suggestions about the API shape and the integration into the event cache, but you're off a great start!
bnjbvr
left a comment
There was a problem hiding this comment.
A few more questions, but this is almost good to land 🥳
bnjbvr
left a comment
There was a problem hiding this comment.
Thanks, approving with some review comments, we can refine it later 👍 Good job!
bnjbvr
left a comment
There was a problem hiding this comment.
See new responses in review comments.
bnjbvr
left a comment
There was a problem hiding this comment.
I hear that some changes are missing from this PR 👀
bnjbvr
left a comment
There was a problem hiding this comment.
Alright, let's ship it, and we'll work on improvements in subsequent PRs. Good job!
| pub(crate) async fn index_event( | ||
| &self, | ||
| event: AnySyncMessageLikeEvent, | ||
| ) -> Result<(), IndexError> { | ||
| self.client.search_index().lock().await.handle_event(event, self.room_id()) | ||
| } |
There was a problem hiding this comment.
I do realize only now; it might be better to have the callers of this method directly call the Client's method, since if they have a Room around they have a Client around. And having Room-methods is mostly nice for public APIs (like search below), otherwise there's no need to have an indirect call structure like this.
862d604 to
7267848
Compare
Integrate matrix-sdk-search into matrix-sdk.
When a room is joined, a corresponding index is created.
When a message is received via sync or via a back-pagination, it is added to the corresponding room's index.
Signed-off-by: Shrey Patel shreyp@element.io