-
Notifications
You must be signed in to change notification settings - Fork 14
feat: Temporary pin discord version #32
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
base: dev
Are you sure you want to change the base?
Conversation
Once Revenge starts fixing versions then channel selection should no longer be an option, please always return the stable channel value If a user is on alpha or anything they already have to reinstall to downgrade to any of these versions listed here |
If possible, comment out the channel selection from settings and see if the value is used anywhere relevant, if it is then keep it for now and set it on init to stable |
I have done what you said. I consider the code to be more future proof with changing the |
I have made this commit as well in an attempt to improve user experience by invalidating custom version set through developer settings, so they aren't required to change it manually. Furthermore, any non stable code won't be accepted |
type | ||
) | ||
//force stable channel | ||
if (type != Type.STABLE) return@with null |
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.
Why do an if here at all if there's only one possible channel? if you're expecting the channel to possibly be different then that's something to look into
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.
I'm expecting it to possibly be different on users that update the manager and have a custom version set in developer settings
//force stable channel | ||
if (type != Type.STABLE) return@with null | ||
// maintain version below 288 | ||
if (287 < toInt() / 1000) |
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.
What's the purpose of this and the else calculation below? aren't we setting a versionCode that we know is working?
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.
The calculation below allows for downgrading while not allowing upgrading, so users can downgrade if they wish to but not to go above a broken version
@@ -24,6 +25,7 @@ data class DiscordVersion( | |||
fun toVersionCode() = "$major${type.ordinal}${if (minor < 10) 0 else ""}${minor}" | |||
|
|||
companion object { | |||
const val LATEST = "287013" |
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.
Maybe this value can be set from an environment variable for the time being until Revenge sets up a domain where the version fixing can be done on
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.
I agree
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.
Maybe we could set up a pseudo API that pulls the version from a JSON in the repo
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.
This is only a temporary solution until Revenge gets a domain that allows it to do that, for now this is good enough
version.isNotBlank() -> DiscordVersion.fromVersionCode(version).toString() | ||
version.isNotBlank() -> (DiscordVersion.fromVersionCode(version)?.toString() ?: run { | ||
version = DiscordVersion.LATEST | ||
DiscordVersion.fromVersionCode(DiscordVersion.LATEST).toString() |
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.
Instead of doing this calculation everywhere, you can make the LATEST have both version name and version code values
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.
Sure, I'll make a commit soom
@@ -74,7 +74,7 @@ class HomeScreen : Screen { | |||
remember(prefs.discordVersion, viewModel.discordVersions, prefs.channel) { | |||
when { | |||
prefs.discordVersion.isBlank() -> viewModel.discordVersions?.get(prefs.channel) | |||
else -> DiscordVersion.fromVersionCode(prefs.discordVersion) | |||
else -> (DiscordVersion.fromVersionCode(prefs.discordVersion) ?: DiscordVersion.fromVersionCode(DiscordVersion.LATEST)) |
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.
Refer to review below
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.
i can not set a plain string to this since a lot of variables require a DiscordVersion
object, and fixing that would require a lot of rewrites. The other commit will be up soon
rscFile.replace("_$postfix.xml", ".xml") | ||
} | ||
}*/ |
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.
What are the changes in these files accomplishing?
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.
Removing the support for anything other than Stable versions, but I get your point
As we already know, revenge is broken on versions newer than 288 (https://discord.com/channels/1205207689832038522/1205211627629191288/1390020789561983046), so this patch limits the manager on the latest working version for all three channels.