Update check: S-22 "Check for update" always asks the server (D-140)

UpdateRepository.checkNow() (default: check(), for throttle-free fakes) skips
the 6-hour throttle of the automatic check (AC-16.2) and restarts its window;
AboutViewModel calls it. Debug builds still never check (AC-16.5).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TQd3pEP9UeN2uifbHknQ7B
This commit is contained in:
2026-10-21 20:56:46 +02:00
parent 50a0d6792a
commit c0f4345ee1
5 changed files with 72 additions and 13 deletions
@@ -38,7 +38,7 @@ sealed interface UpdateState {
data class NeedsInstallPermission(val info: UpdateInfo) : UpdateState
}
/** The outcome of [UpdateRepository.check] (S-22, AC-16.6). */
/** The outcome of [UpdateRepository.check] and [UpdateRepository.checkNow] (S-22, AC-16.6). */
sealed interface UpdateCheck {
/** No newer APK is published (or nothing is published); debug builds, which never check (AC-16.5), report this too. */
data object UpToDate : UpdateCheck
@@ -51,7 +51,16 @@ sealed interface UpdateCheck {
interface UpdateRepository {
val state: Flow<UpdateState>
/** The automatic check (cold start, resume): at most one request every 6 hours (AC-16.2). */
suspend fun check(): UpdateCheck
/**
* S-22 "Check for update" (AC-16.6, D-140): always asks the server and restarts the 6-hour window. An
* implementation without a throttle (the fakes) needs nothing more than [check].
*/
suspend fun checkNow(): UpdateCheck = check()
suspend fun install()
}