This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Deduplicate is_server_notices_room
.
#13780
Merged
Merged
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
2fbc514
Deduplicate is_server_notice_room
reivilibre 8356925
Newsfile
reivilibre f51e9ef
Merge branch 'develop' into rei/dedupe_is_server_notice_room
reivilibre f811977
Merge branch 'develop' into rei/dedupe_is_server_notice_room
reivilibre 75f0346
Move to the datastore instead
reivilibre cc82b78
Add docstring
reivilibre File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Deduplicate `is_server_notices_room`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 introduces a dependency
MessageHandler -> RoomMemberHandler
.Does it make sense for handlers to interdepend?
(I expect this is no worse than we do elsewhere, so this is probably fine)
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 is one of those things that I don't know the answer to myself, actually. It seems objectively worse to have the redundancy though, but maybe I'll ask around...
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.
We try and avoid it where possible, as we need to make sure that
RoomMemberHandler
is initialised before we start the homeserver (as handlers may raise on config errors etc), and doing inlinehs.get_*
obviously means we can't necessarily guarantee that if all other usages also get inlined.In this particular case: it feels like
is_server_notices_room
could either be moved intoServerNoticesManager
or into the data store?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 never know what the distinction is meant to be between managers and handlers, but a note:
ServerNoticesManager
calls intoRoomMemberHandler
(it takes a reference to it in__init__
too).If I move the function into there, we'll still have a circular dependency.
I didn't really realise that
get_*
was doing lazy initialisation.I'll try putting it into the data store.