fix: recognize stable APK releases as newer than release candidates (#1184)

This commit is contained in:
M57
2026-09-17 22:00:12 +03:00
committed by GitHub
parent e78dd6bfff
commit c2cb08a563
5 changed files with 196 additions and 18 deletions
@@ -166,6 +166,21 @@ class AppUpdateViewModelTest {
// ── Manual check ────────────────────────────────────────────────────
@Test
fun checkForUpdate_stableReleasePromptsInstalledRc() =
runTest {
coEvery { checker.fetchLatestRelease() } returns updateInfo(tag = "v1.25")
val vm = AppUpdateViewModel(app, checker, "1.25.rc.1", testDispatcher)
advanceUntilIdle()
vm.checkForUpdate()
advanceUntilIdle()
assertTrue(vm.state.value is AppUpdateState.UpdateAvailable)
assertEquals("v1.25", (vm.state.value as AppUpdateState.UpdateAvailable).latestTag)
assertEquals(vm.state.value, AppUpdateCache.state.value)
}
@Test
fun checkForUpdate_upToDateWhenSameVersion() =
runTest {