Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Type checking for FederationHandler #7770

Merged
merged 1 commit into from
Jul 1, 2020
Merged

Type checking for FederationHandler #7770

merged 1 commit into from
Jul 1, 2020

Conversation

richvdh
Copy link
Member

@richvdh richvdh commented Jul 1, 2020

fix a few things to make this pass mypy.

@richvdh richvdh requested a review from a team July 1, 2020 13:26
fix a few things to make this pass mypy.
@richvdh richvdh force-pushed the rav/mypy_fedhandler branch from c01a8bc to 4767c1f Compare July 1, 2020 13:31
Comment on lines +2839 to +2842
if last_exception is None:
# we can only get here if get_public_keys() returned an empty list
# TODO: make this better
raise RuntimeError("no public key in invite event")
Copy link
Member

Choose a reason for hiding this comment

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

Seems fine, but curious if we were actually running into it?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think so, but I had to do something here to keep mypy happy.

Copy link
Member Author

Choose a reason for hiding this comment

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

in theory I suspect we could run into it if the invite was malformed.

Copy link
Member

Choose a reason for hiding this comment

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

Makes sense! The result is similar either way, wasn't sure if you came across it in Sentry or something. 👍

@richvdh richvdh merged commit a6eae69 into develop Jul 1, 2020
@richvdh richvdh deleted the rav/mypy_fedhandler branch July 1, 2020 15:21
babolivier pushed a commit that referenced this pull request Sep 1, 2021
* commit '5cdca53aa':
  Merge different Resource implementation classes (#7732)
  Fix inconsistent handling of upper and lower cases of email addresses. (#7021)
  Allow YAML config file to contain None (#7779)
  Fix a typo.
  Move 1.15.2 after 1.16.0rc2.
  1.16.0rc2
  Remove an extraneous space.
  Add links to the fixes.
  Fix tense in the release notes.
  Hack to add push priority to push notifications (#7765)
  Add early returns to `_check_for_soft_fail` (#7769)
  Use symbolic names for replication stream names (#7768)
  Type checking for `FederationHandler` (#7770)
  Fix new metric where we used ms instead of seconds (#7771)
  Fix incorrect error message when database CTYPE was set incorrectly. (#7760)
  Pin link in CHANGES.md
  Fixes to CHANGES.md
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants