-
Notifications
You must be signed in to change notification settings - Fork 6k
Feat: Downgrade to 1.1 #3576
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
Feat: Downgrade to 1.1 #3576
Conversation
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.
Hey! Looks like you edited README.rst or README_RAW.rst. I'm just a friendly reminder to apply relevant changes to both of those files :)
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.
Hey! Looks like you edited the (optional) requirements or the pre-commit hooks. I'm just a friendly reminder to keep the additional dependencies for the hooks in sync with the requirements :)
I don't think this is more readable but who am I to argue with deepsource.
Words hard.
Bibo-Joshi
left a comment
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.
Thanks for the PR!
I decided to go for warning when a custom http://, not https:// URL is set.
IISC the logic for the warnings-checking is not yet covering everything. After reviewing your changes, the different scenarios (all considering the user passed http_version="2") that I see are:
- User is using cloud api -> base url starts with https://,
local_mode is False, everything should work - User is using a self-hosted, non-local API server, with or without HTTP/1.1 proxy -> base_url can be either http://… or https://…,
local_mode is False, will not work due to HTTP/2 - User is using a self-hosted, non-local API server with a HTTP/2 proxy -> base_url can be either http://… or https://…,
local_mode is False, will work due to proxy - User is using a self-hosted local API server with or without a HTTP/1.1 proxy -> base_url is http://…,
local_mode is True, will not work due to HTTP/2 - User is using a self-hosted local API server with a HTTP/2 proxy -> base_url can be http://… or https://…,
local_mode is True, will not work due to proxy
In summary all combinations of http(s) & local_mode=True/False can either work or not work. IMO we should just issue a warning as soon as we know that the user is using a self hosted API server. This will give a few false positives, but it's only a warning after all …
I guess the only reliable way to check if the user is using a self-hosted API server is to check if "://api.telegram.org/" in base_(file_)url …
I also decided to call the next version 20.1.1, I think this issue warrants a release since users face errors because of us which are hard to spot/track down in production.
Fine with me 👍
I also decided to change away the [http2] dependency, I hope this doesn't break anything.
Please make it a proper optional dependency via requirements-opts.txt and also add unit test for that :)
|
@Bibo-Joshi You mention |
|
@Poolitzer good point. |
Bibo-Joshi
left a comment
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.
Thanks for the updates! The warning logic now LGTM :)
Co-authored-by: Bibo-Joshi <22366557+Bibo-Joshi@users.noreply.github.com>
Also broke the warning logic wuuups
Co-authored-by: Bibo-Joshi <22366557+Bibo-Joshi@users.noreply.github.com>
Bibo-Joshi
left a comment
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.
LGTM! If there's nothing left from your side, we can merge IMO :)
|
@Bibo-Joshi Nothing from me |
harshil21
left a comment
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.
looks good, just 2 test class renaming suggestions..
Co-authored-by: Harshil <37377066+harshil21@users.noreply.github.com>
I decided to go for warning when a custom http://, not https:// URL is set. I also decided to call the next version 20.1.1, I think this issue warrants a release since users face errors because of us which are hard to spot/track down in production.
I also decided to change away the [http2] dependency, I hope this doesn't break anything.