Open source Grok Bot alternative, Bring your own agent and subscription: message Claude Code, Codex, Gemini CLI, Cursor, Copilot and 40+ AI agents as bots on your own computer, from iPhone, Mac, Windows, Linux or terminal. Agent-agnostic and free. Also a Muse and Dots alternative. Built in Rust.
Rust acpagent-client-protocolai-agentsai-assistantclaudeclaude-codecodexcoding-agentscursorgeminigemini-cligrok-bot-alternativeiosiphonelinuxmacosmcpopen-sourcerustself-hosted
fix(android): keep widgets updating with several computers and the review invitation from cancelling itself
leepokai309c0d8fd7cd
diff --git a/apps/android/app/src/main/kotlin/com/codync/android/ReviewPrompt.kt b/apps/android/app/src/main/kotlin/com/codync/android/ReviewPrompt.ktindex 2c749b15..047a0294 100644--- a/apps/android/app/src/main/kotlin/com/codync/android/ReviewPrompt.kt+++ b/apps/android/app/src/main/kotlin/com/codync/android/ReviewPrompt.kt@@ -9,6 +9,7 @@ import androidx.compose.runtime.collectAsStateimport androidx.compose.runtime.getValueimport androidx.compose.runtime.mutableStateOfimport androidx.compose.runtime.remember+import androidx.compose.runtime.rememberCoroutineScopeimport androidx.compose.runtime.setValueimport androidx.compose.ui.platform.LocalContextimport androidx.core.content.edit@@ -23,6 +24,7 @@ import com.google.android.play.core.ktx.launchReviewimport com.google.android.play.core.ktx.requestReviewimport kotlinx.coroutines.CancellationExceptionimport kotlinx.coroutines.delay+import kotlinx.coroutines.launchimport kotlinx.coroutines.flow.MutableStateFlowimport kotlinx.coroutines.flow.asStateFlow@@ -114,16 +116,20 @@ internal val AppState.settledForReview: Boolean@Composable internal fun ReviewInvitationEffect(blocked: Boolean) {val context = LocalContext.currentval token by ReviewPrompt.opportunity.collectAsState()+ // `request` clears the opportunity, which restarts this effect, so Play's request runs outside it.+ val scope = rememberCoroutineScope()LaunchedEffect(token, blocked) {val opportunity = token ?: return@LaunchedEffectif (blocked) { ReviewPrompt.cancel(context, ReviewCancellation.Unavailable); return@LaunchedEffect }delay(2_000)val activity = context as? Activity ?: return@LaunchedEffect ReviewPrompt.cancel(context, ReviewCancellation.Unavailable)if (!ReviewPrompt.request(context, opportunity)) return@LaunchedEffect- try {- val manager = ReviewManagerFactory.create(context)- manager.launchReview(activity, manager.requestReview())- } catch (cancelled: CancellationException) { throw cancelled }- catch (error: Exception) { android.util.Log.i("Codync", "Review prompt unavailable: ${error.message}") }+ scope.launch {+ try {+ val manager = ReviewManagerFactory.create(context)+ manager.launchReview(activity, manager.requestReview())+ } catch (cancelled: CancellationException) { throw cancelled }+ catch (error: Exception) { android.util.Log.i("Codync", "Review prompt unavailable: ${error.message}") }+ }}}diff --git a/apps/android/app/src/main/kotlin/com/codync/android/WidgetRefreshWorker.kt b/apps/android/app/src/main/kotlin/com/codync/android/WidgetRefreshWorker.ktindex ebac5f25..7707060f 100644--- a/apps/android/app/src/main/kotlin/com/codync/android/WidgetRefreshWorker.kt+++ b/apps/android/app/src/main/kotlin/com/codync/android/WidgetRefreshWorker.kt@@ -11,6 +11,7 @@ import kotlinx.coroutines.awaitAllimport kotlinx.coroutines.coroutineScopeimport kotlinx.coroutines.withContextimport kotlinx.coroutines.withTimeout+import kotlinx.coroutines.withTimeoutOrNullimport kotlinx.coroutines.TimeoutCancellationExceptionimport kotlinx.coroutines.sync.Muteximport kotlinx.coroutines.sync.withLock@@ -39,11 +40,11 @@ class WidgetRefreshWorker(context: Context, parameters: WorkerParameters) : Coroif (computers.isEmpty()) return@withTimeout falseval usageId = computers.currentId(withContext(Dispatchers.IO) { local.lastComputer() })val identity = withContext(Dispatchers.IO) { local.identity() }- // Each computer at once; one that can't be reached keeps the bots it had (and isn't fresh).+ // Each computer at once, each in its own 20 s; one that can't be reached keeps the bots it had (and isn't fresh).val reads = coroutineScope {computers.map { computer ->async {- try { read(computer, identity, computer.id == usageId) }+ try { withTimeoutOrNull(20_000) { read(computer, identity, computer.id == usageId) } }catch (cancelled: CancellationException) { throw cancelled }catch (error: Exception) { android.util.Log.i("Codync", "Widget refresh couldn't read ${computer.id}: ${error.message}"); null }}diff --git a/apps/android/core/src/main/kotlin/com/codync/android/core/CustomIcon.kt b/apps/android/core/src/main/kotlin/com/codync/android/core/CustomIcon.ktindex 10a2483f..1916eb5f 100644--- a/apps/android/core/src/main/kotlin/com/codync/android/core/CustomIcon.kt+++ b/apps/android/core/src/main/kotlin/com/codync/android/core/CustomIcon.kt@@ -11,5 +11,5 @@ fun decodeCustomIcons(value: JsonElement): Map<String, CustomIcon> = WireJson.de/** Apply the current image snapshot, including removals, without replacing fresh bot metadata. */fun List<Bot>.withCustomIcons(icons: Map<String, CustomIcon>): List<Bot> = map { it.copy(customIcon = icons["bot:${it.id}"]) }-/** 128 normalized images plus the existing 512 KiB summary allowance. */-const val MAX_WIDGET_FEED_BYTES = 128 * 65_558 + 512 * 1024+/** A normalized image for each of the feed's 256 bots (every computer's), plus the 512 KiB summary allowance. */+const val MAX_WIDGET_FEED_BYTES = 256 * 65_558 + 512 * 1024