Skip to content

chore(sdk): Rename RoomEventCacheListener to RoomEventCacheSubscriber#5269

Merged
Hywan merged 5 commits intomatrix-org:mainfrom
Hywan:chore-sdk-event-cache-listener-renaming
Jun 23, 2025
Merged

chore(sdk): Rename RoomEventCacheListener to RoomEventCacheSubscriber#5269
Hywan merged 5 commits intomatrix-org:mainfrom
Hywan:chore-sdk-event-cache-listener-renaming

Conversation

@Hywan
Copy link
Member

@Hywan Hywan commented Jun 23, 2025

Extracted from #5247.

This patch removes a name ambiguity around listener vs. subscriber.
Both terms are used to talk about RoomEventCacheListener. We usually
use the term subscriber for the type being returned by a subscribe
method. The code refers to this sometimes as listener, sometimes
as subscriber, sometimes both in the same sentence, which can be very
confusing! This patch solves this by using the subscriber term only.

Moreover, the term listener refers to a callback (usually a function) that is
passed to an event-based or reactive system, like we have in matrix_sdk_ffi
for example. It's not appropriate here.

Hywan added 5 commits June 23, 2025 15:03
This patch renames a variable to match the `EventCacheDropHandles`
field's name.
This patch renames `tx` and `rx` to `auto_shrink_sender` and
`auto_shrink_receiver` to clarify the code.
…criber`.

This patch removes a name ambiguity around _listener_ vs. _subscriber_.
Both terms are used to talk about `RoomEventCacheListener`. We usually
use the term _subscriber_ for the type being returned by a `subscribe`
method. The code refers to this sometimes as listener, sometimes
as subscriber, sometimes both in the same sentence, which can be very
confusing! This patch solves this by using the _subscriber_ term only.
@Hywan Hywan marked this pull request as ready for review June 23, 2025 13:15
@Hywan Hywan requested a review from a team as a code owner June 23, 2025 13:15
@Hywan Hywan requested review from poljar and removed request for a team June 23, 2025 13:15
@codecov
Copy link

codecov bot commented Jun 23, 2025

Codecov Report

Attention: Patch coverage is 85.71429% with 4 lines in your changes missing coverage. Please review.

Project coverage is 90.20%. Comparing base (25d217c) to head (bb2c520).
Report is 6 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
crates/matrix-sdk/src/event_cache/room/mod.rs 78.94% 1 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5269      +/-   ##
==========================================
+ Coverage   90.18%   90.20%   +0.01%     
==========================================
  Files         334      334              
  Lines      104822   104825       +3     
  Branches   104822   104825       +3     
==========================================
+ Hits        94535    94557      +22     
+ Misses       6235     6216      -19     
  Partials     4052     4052              

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

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.

lgtm, thanks!

@Hywan Hywan merged commit ef13773 into matrix-org:main Jun 23, 2025
44 checks passed
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.

2 participants