Update check runs on every cold start instead of a 6h throttle
Code Quality Checks / Search for forbidden patterns (push) Has been cancelled
Code Quality Checks / Search for invalid screenshot files (push) Has been cancelled
Code Quality Checks / Search for invalid dependencies (push) Has been cancelled
Code Quality Checks / Konsist tests (push) Has been cancelled
Code Quality Checks / Compose tests (push) Has been cancelled
Code Quality Checks / Android lint check (push) Has been cancelled
Code Quality Checks / Detekt checks (push) Has been cancelled
Code Quality Checks / Ktlint checks (push) Has been cancelled
Code Quality Checks / Doc checks (push) Has been cancelled
Code Quality Checks / Check shell scripts (push) Has been cancelled
Code Quality Checks / Run zizmor (push) Has been cancelled
Create release App Bundle and APKs / Create App Bundle (Gplay) (push) Has been cancelled
Create release App Bundle and APKs / Create APKs (FDroid) (push) Has been cancelled
Sonar / Sonar Quality Checks (push) Has been cancelled
Test / Runs unit tests (push) Has been cancelled
Code Quality Checks / Project Check Suite (push) Has been cancelled
Create release App Bundle and APKs / Create App Bundle Enterprise (push) Has been cancelled

One GET to our own Gitea per launch is nothing, and it makes the updater
predictable: publish a release, users see the banner on next open.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-30 10:24:34 -07:00
parent e752a456f7
commit bee0c46eff
@@ -230,16 +230,13 @@ class RoomListPresenter(
}
}
// Blap: in-app update check — throttled, so most launches make no network call.
// Blap: in-app update check — every cold start (one cheap GET to our own Gitea);
// an update is offered the first launch after it's published, no waiting window.
var blapUpdateInfo by remember { mutableStateOf<BlapUpdateInfo?>(null) }
var blapUpdateDownloading by remember { mutableStateOf(false) }
var blapUpdateFailed by remember { mutableStateOf(false) }
LaunchedEffect(Unit) {
val now = System.currentTimeMillis()
val lastCheck = sharedPreferences.getLong(BLAP_UPDATE_LAST_CHECK_KEY, 0L)
if (now - lastCheck < BLAP_UPDATE_CHECK_INTERVAL_MS) return@LaunchedEffect
val info = blapUpdateChecker.check()
sharedPreferences.edit { putLong(BLAP_UPDATE_LAST_CHECK_KEY, now) }
if (info != null && info.version != sharedPreferences.getString(BLAP_UPDATE_DISMISSED_KEY, null)) {
blapUpdateInfo = info
}
@@ -443,9 +440,7 @@ class RoomListPresenter(
const val BLAP_VOICE_ROOMS_KEY = "blap_voice_room_ids"
const val BLAP_SPACE_OWNED_KEY = "blap_space_owned_room_ids"
const val BLAP_NESTED_SPACES_KEY = "blap_nested_space_ids"
const val BLAP_UPDATE_LAST_CHECK_KEY = "blap_update_last_check"
const val BLAP_UPDATE_DISMISSED_KEY = "blap_update_dismissed_version"
const val BLAP_UPDATE_CHECK_INTERVAL_MS = 6 * 60 * 60 * 1000L
}
@Composable