Skip to content

Conversation

dragonfly1033
Copy link
Contributor

@dragonfly1033 dragonfly1033 commented Aug 7, 2025

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 [email protected]

@dragonfly1033 dragonfly1033 requested a review from a team as a code owner August 7, 2025 17:36
@dragonfly1033 dragonfly1033 requested review from andybalaam and removed request for a team August 7, 2025 17:36
Copy link

codecov bot commented Aug 7, 2025

Codecov Report

❌ Patch coverage is 80.80808% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.58%. Comparing base (6c944a9) to head (7267848).
⚠️ Report is 47 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
crates/matrix-sdk-search/src/schema.rs 72.41% 7 Missing and 1 partial ⚠️
crates/matrix-sdk/src/event_cache/pagination.rs 66.66% 4 Missing and 1 partial ⚠️
crates/matrix-sdk/src/event_cache/room/mod.rs 84.00% 0 Missing and 4 partials ⚠️
crates/matrix-sdk-search/src/index.rs 92.00% 0 Missing and 2 partials ⚠️
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.
📢 Have feedback on the report? Share it here.

Copy link

codspeed-hq bot commented Aug 7, 2025

CodSpeed Performance Report

Merging #5505 will not alter performance

Comparing dragonfly1033/integrate-search (7267848) with main (0e70a2f)

Summary

✅ 31 untouched benchmarks

@dragonfly1033 dragonfly1033 force-pushed the dragonfly1033/integrate-search branch from d771525 to 815f511 Compare August 7, 2025 18:01
@andybalaam andybalaam requested review from poljar and removed request for andybalaam August 8, 2025 08:13
@andybalaam
Copy link
Member

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.

@bnjbvr bnjbvr requested review from bnjbvr and removed request for poljar August 11, 2025 08:22
@dragonfly1033 dragonfly1033 requested a review from a team as a code owner August 11, 2025 08:47
@dragonfly1033 dragonfly1033 requested review from richvdh and removed request for a team August 11, 2025 08:47
@dragonfly1033 dragonfly1033 marked this pull request as draft August 11, 2025 08:51
@dragonfly1033 dragonfly1033 force-pushed the dragonfly1033/integrate-search branch from 8c7da74 to 7d21856 Compare August 11, 2025 08:54
@dragonfly1033 dragonfly1033 removed the request for review from richvdh August 11, 2025 08:54
Copy link
Member

@bnjbvr bnjbvr left a comment

Choose a reason for hiding this comment

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

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!

@dragonfly1033 dragonfly1033 marked this pull request as ready for review August 11, 2025 15:04
@dragonfly1033 dragonfly1033 requested a review from bnjbvr August 11, 2025 15:04
Copy link
Member

@bnjbvr bnjbvr left a comment

Choose a reason for hiding this comment

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

A few more questions, but this is almost good to land 🥳

@dragonfly1033 dragonfly1033 requested a review from bnjbvr August 13, 2025 09:40
Copy link
Member

@bnjbvr bnjbvr left a comment

Choose a reason for hiding this comment

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

Thanks, approving with some review comments, we can refine it later 👍 Good job!

Copy link
Member

@bnjbvr bnjbvr left a comment

Choose a reason for hiding this comment

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

See new responses in review comments.

@dragonfly1033 dragonfly1033 requested a review from bnjbvr August 14, 2025 10:39
Copy link
Member

@bnjbvr bnjbvr left a comment

Choose a reason for hiding this comment

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

I hear that some changes are missing from this PR 👀

@dragonfly1033 dragonfly1033 requested a review from bnjbvr August 14, 2025 12:16
Copy link
Member

@bnjbvr bnjbvr left a comment

Choose a reason for hiding this comment

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

Alright, let's ship it, and we'll work on improvements in subsequent PRs. Good job!

Comment on lines +3685 to +3690
pub(crate) async fn index_event(
&self,
event: AnySyncMessageLikeEvent,
) -> Result<(), IndexError> {
self.client.search_index().lock().await.handle_event(event, self.room_id())
}
Copy link
Member

Choose a reason for hiding this comment

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

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.

@dragonfly1033 dragonfly1033 force-pushed the dragonfly1033/integrate-search branch from 862d604 to 7267848 Compare August 18, 2025 11:59
@bnjbvr bnjbvr changed the title feat(sdk): Add creation of indexes and indexing of messages. feat(sdk): Add creation of indexes and indexing of messages Aug 18, 2025
@bnjbvr bnjbvr merged commit 13c30f6 into main Aug 18, 2025
52 checks passed
@bnjbvr bnjbvr deleted the dragonfly1033/integrate-search branch August 18, 2025 12:52
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.

3 participants