-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
fix: update server version endpoint with optional python version #23
Conversation
5d0bb7c
to
deb14a8
Compare
Signed-off-by: Hanadi92 <hanadi.tamimi@gmail.com>
deb14a8
to
bf5954b
Compare
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! Could you update the CHANGELOG.md
too, please?
src/version/get_server_version/v1.rs
Outdated
@@ -33,7 +37,51 @@ impl Request { | |||
|
|||
impl Response { | |||
/// Creates a `Response` with the given Synapse and Python versions. | |||
pub fn new(server_version: String, python_version: String) -> Self { | |||
pub fn new(server_version: String, python_version: Option<String>) -> Self { |
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.
Could you just remove the python_version
parameter instead? I don't think a Rust server implementation usually has a reason to set this field, and it can still be set to Some
via direct field access after creating the response with Response::new
.
It's a breaking change either way.
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.
Do you mean something like this?
pub fn new(server_version: String) -> Self {
Self { server_version, python_version: None }
}
Or completely removing the python_version from the Response struct (which would break old versions no?)
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, I mean exactly what you put in the code snippet. Removing the fields wouldn't break clients that deserialize this response and only check the synapse version field, but I think it's slightly more useful to keep the field, but remove it from the constructor.
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.
Done ✅ Thank you so much for your review!
Co-authored-by: Jonas Platte <jplatte+git@posteo.de>
Signed-off-by: Hanadi92 <hanadi.tamimi@gmail.com>
Signed-off-by: Hanadi92 <hanadi.tamimi@gmail.com>
As mentioned in the docs of admin api, the python_version is no longer part of the response since 1.94.0.
Signed off: @hanadi92