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
Refactors in _generate_sync_entry_for_rooms
#11515
Merged
Merged
Changes from 1 commit
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
36357f3
Move sync_token up to the top
f9dff2d
Pull out _get_ignored_users
0af0643
Try to signpost the body of `_generate_sync_entry_for_rooms`
963de4e
Pull out _calculate_user_changes
bca977c
Add docstring for _calculate_user_changes
0e2c6f6
Introduce membership_changes_summary
463d2fd
Changelog
d8aa9d0
Update synapse/handlers/sync.py
dba7c94
docstring for _get_ignored_users
ecccfb4
Note that we could use a DB table
c384789
Revert "Introduce membership_changes_summary"
dd39d82
Remove unnecessary quote marks.
d9cf23d
Make `_calculate_user_changes` a method
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
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.
I wonder if this should be start of
SyncResultBuilder
?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.
Not sure what you mean here, sorry. Perhaps that this ought to be placed above the definition of
SyncResultBuilder
?Oh, actually I think you mean the quotes are unnecessary.
(My personal preference would be to move SyncResultBuilder and all other POD structs/classes all the way up to the top of the file, so the quotes aren't needed throughout.)
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.
Trimmed quotes in dd39d82.
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 I meant to say was:
As in a method on that class! Clearly I failed to say anything reasonable.
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.
Ahh, I see. I considered this, but opted to make
_calculate_user_changes
a free function, to try and suggest that it's just reading data and not mutating theSyncResultBuilder
instance.I think this is just an old C++ habit dying hard though. Happy to go with whatever you think is clearest!
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 it is fine either way,
SyncResultBuilder
seems to just be a way to pass around mutable state so probably best to keep logic out of it.