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

Validate server version on session restore and show outdated server notification #1826

Merged

Conversation

nielsvanvelzen
Copy link
Member

Changes

  • Validate server version on session restore
    • This prevents autologin from opening a 10.7 server (which is incompatible)
  • Show notification when server version is not supported
    • Shows on the user selection screen, it's kinda big:

image

Note that trying to add a user or selecting one also shows an error that the server is outdated. The server information update when opening this screen and when restoring a session (with a ratelimit of once every 10 minutes). So if the user updates their server and reopenens the app the info should update and go back to autologin.

Issues

val now = Date().time

// Only update every 10 minutes
if (now - server.lastRefreshed < 600000 && server.version != null) return null

Check notice

Code scanning

Report magic numbers. Magic number is a numeric literal that is not defined as a constant and hence it's unclear what the purpose of this number is. It's better to declare such numbers as constants and give them a proper name. By default, -1, 0, 1, and 2 are not considered to be magic numbers.

This expression contains a magic number. Consider defining it to a well named constant.
@nielsvanvelzen nielsvanvelzen merged commit 1948858 into jellyfin:master Jul 10, 2022
@nielsvanvelzen nielsvanvelzen deleted the server-version-validation branch July 10, 2022 07:55
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.

1 participant