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

Remove python client version check #676

Closed
Brutus5000 opened this issue Oct 1, 2020 · 3 comments · Fixed by #677
Closed

Remove python client version check #676

Brutus5000 opened this issue Oct 1, 2020 · 3 comments · Fixed by #677

Comments

@Brutus5000
Copy link
Member

I would like to drop the table version_lobby in the database. The whole version check is sort of pointless today. The database records point to the download of the java client and the minimum version is 0.13.0 which is like 5 years old. Seems like it's completely useless.

Both clients have an auto-update mechanism outside of the faf-database.

Related code (didn't check for tests):

self.client_version_info = ("0.0.0", None)

# Client version number
result = await conn.execute(
"SELECT version, file FROM version_lobby ORDER BY id DESC LIMIT 1"
)
row = await result.fetchone()
if row is not None:
self.client_version_info = (row[0], row[1])

versionDB, updateFile = self.player_service.client_version_info
update_msg = {
"command": "update",
"update": updateFile,
"new_version": versionDB
}
if not self.user_agent or "downlords-faf-client" not in self.user_agent:
await self.send_warning(
"You are using an unofficial client version! "
"Some features might not work as expected. "
"If you experience any problems please download the latest "
"version of the official client from "
f'<a href="{config.WWW_URL}">{config.WWW_URL}</a>'
)
if not self._version or not self.user_agent:
update_msg["command"] = "welcome"
# For compatibility with 0.10.x updating mechanism
await self.send(update_msg)
return False

@andrewmiko
Copy link
Contributor

I can work on this issue during #hacktoberfest. Is this about remove code which is somehow related to self.client_version_info and table version_lobby?

I've found 1 test here:

assert player_service.client_version_info == ("0.10.125", "some-installer.msi")

Should this line be removed from test too?

Thanks.

@Askaholic
Copy link
Collaborator

Yea that’s right. We don’t need to be keeping track of client version numbers at all, so we can just remove any reference to that attribute. You can also run the tests and see what fails after you remove stuff (use the Travis build if you don’t want to set it up locally). Removing this code will also let us get rid of the semver dependency (need to update Pipfile and Pipfile.lock)

@andrewmiko
Copy link
Contributor

@Askaholic thanks. I will work on it.

Askaholic pushed a commit that referenced this issue Oct 5, 2020
* Removed semver package deprecation warning from pytest

* Removed _check_version method and semver package

* Removed client_version_info from PlayerService

* Removed client_version_info from test_update_data unittest

* Removed test_server_deprecated_client test

* Restored and renamed _check_version to _check_user_agent

* Restored test_server_deprecated_client test

* Removed version_lobby from test-data.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants