fix: keep a Nightly guess backed by published preview history

This commit is contained in:
Kurt Himebauch committed 2026-10-25 19:24:43 -04:00
1 parent 1ee597e07f
commit 0ec1fe1bdc
2 files changed
+3 -3

No files matched your search

@@ -224,7 +224,7 @@ object AppUpdates {
catalog.recentPreviews.any { matchesInstalledCommit(it.commit, me.commit) }
)
if (stable?.version?.let { compareVersions(me.version, it) < 0 } == true) return Guess(Follow(Channel.STABLE), !publishedPreview)
return Guess(Follow(if (publishedPreview) Channel.NIGHTLY else Channel.STABLE), false)
return Guess(Follow(if (publishedPreview) Channel.NIGHTLY else Channel.STABLE), publishedPreview)
}
fun setFollow(context: Context, follow: Follow) {
@@ -330,11 +330,11 @@ class AppUpdatesTest {
assertTrue(g.certain)
}
@Test fun aPublishedPreviewPastStableIsNightlyButNotSaved() {
@Test fun aPublishedPreviewPastStableIsCertainNightly() {
val withHistory = AppUpdates.Catalog(stable, release("1111111"), emptyList(), 0L, recentPreview)
val g = AppUpdates.guessFollow(withHistory, me("2".repeat(40), version = "0.3.0"))
assertEquals(AppUpdates.Channel.NIGHTLY, g.follow.channel)
assertFalse(g.certain)
assertTrue(g.certain)
}
@Test fun anUncataloguedNewerBuildStaysStableForNow() {