This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
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.
Fix a typing issue in the federation client code found with mypy #7089
Fix a typing issue in the federation client code found with mypy #7089
Changes from 1 commit
c37c793
c7f2015
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 saying that we should undo it (it's certainly much cleaner now), but for the record: this seems to go beyond what is needed to fix the issue here. afaict only the calls to
_check_sigs_and_hash_and_fetch
needed changing;_check_sigs_and_hash
,_check_sigs_and_hashes
and_check_sigs_on_pdus
were ok.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.
Yes, it does go a bit beyond the minimum, but it seemed clearer / more efficient to not switch back and forth between
RoomVersion
and astr
repeatedly.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.
yup, fair.
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.
One difference here is that
get_room_version_id
has an LRU cache in front of it whileget_room_version
does not. I'm unsure how much this matters in practice, but thought it was worth pointing out.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.
It doesn't really matter, because
get_room_version
is a thin wrapper aroundget_room_version_id
; the slow bit (going to the db) is still cached.