Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sydent.threepid pass mypy --strict #427

Merged
merged 4 commits into from
Oct 19, 2021
Merged

Conversation

DMRobertson
Copy link
Contributor

Part of #414

I was sad to get rid of the TypedDict from sydent.db.invite_tokens, but given that we immediately use it by adding extra keys, it wasn't worth the effort. Oh well.

@DMRobertson DMRobertson force-pushed the dmr/mypy-threepid branch 2 times, most recently from c2dca4d to f5f785e Compare October 15, 2021 18:15
@DMRobertson
Copy link
Contributor Author

Oops, I confused my branches.

@DMRobertson DMRobertson requested review from a team and removed request for a team October 15, 2021 18:16
something something LET IT GOOOOOOO
Copy link
Contributor

@reivilibre reivilibre left a comment

Choose a reason for hiding this comment

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

Thanks for tackling this :)

sydent/db/invite_tokens.py Show resolved Hide resolved
sydent/sydent.py Show resolved Hide resolved
Comment on lines 97 to 102
token["signed"] = {
"mxid": mxid,
"token": cast(str, token["token"]),
}
token["signed"] = signedjson.sign.sign_json(
token["signed"],
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't seem to be identical behaviour: you've dropped the "token" key from the dict that's being signed?
Is there some reason why this is justifiable?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No. I'm not sure what I was thinking here. I'll take another look.

@reivilibre reivilibre removed their assignment Oct 19, 2021
Copy link
Contributor

@reivilibre reivilibre left a comment

Choose a reason for hiding this comment

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

LGTM

@DMRobertson
Copy link
Contributor Author

Many thanks!

@DMRobertson DMRobertson merged commit 719ad45 into main Oct 19, 2021
@DMRobertson DMRobertson deleted the dmr/mypy-threepid branch October 19, 2021 13:08
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