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

Fix/web interface manager get latest compatible version #706

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ object WebInterfaceManager {
private val logger = KotlinLogging.logger {}
private val scope = CoroutineScope(SupervisorJob() + Dispatchers.Default)

private const val WEBUI_PREVIEW_VERSION = "PREVIEW"
private const val LAST_WEBUI_UPDATE_CHECK_KEY = "lastWebUIUpdateCheckKey"

private val preferences = Preferences.userNodeForPackage(WebInterfaceManager::class.java)
Expand Down Expand Up @@ -479,15 +478,24 @@ object WebInterfaceManager {
?: throw Exception("Invalid mappingFile")
val minServerVersionNumber = extractVersion(minServerVersionString)

val ignorePreviewVersion =
!WebUIChannel.doesConfigChannelEqual(WebUIChannel.PREVIEW) && webUIVersion == WEBUI_PREVIEW_VERSION
if (ignorePreviewVersion) {
continue
} else {
if (!WebUIChannel.doesConfigChannelEqual(WebUIChannel.from(webUIVersion))) {
// allow only STABLE versions for STABLE channel
if (WebUIChannel.doesConfigChannelEqual(WebUIChannel.STABLE)) {
continue
}

// allow all versions for PREVIEW channel
}

if (webUIVersion == WebUIChannel.PREVIEW.name) {
webUIVersion = fetchPreviewVersion()
}

val isCompatibleVersion = minServerVersionNumber <= currentServerVersionNumber
val isCompatibleVersion =
minServerVersionNumber <= currentServerVersionNumber && minServerVersionNumber >=
extractVersion(
BuildConfig.WEBUI_TAG,
)
if (isCompatibleVersion) {
return webUIVersion
}
Expand Down