Skip to content

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.

fix(android): retain approval while switching computers

leepokaifb82a9d14164
diff --git a/apps/android/app/src/androidTest/kotlin/com/codync/android/AccountScreenTest.kt b/apps/android/app/src/androidTest/kotlin/com/codync/android/AccountScreenTest.kt
index 2e3c33b4..e222f63e 100644
--- a/apps/android/app/src/androidTest/kotlin/com/codync/android/AccountScreenTest.kt
+++ b/apps/android/app/src/androidTest/kotlin/com/codync/android/AccountScreenTest.kt
@@ -232,6 +232,32 @@ class AccountScreenTest {
compose.runOnIdle { assertEquals(listOf("first", "finished", "approved"), calls) }
}
+ @Test fun approvalRemainsVisibleWhileTheComputerHandoffWaits() {
+ lateinit var store: AppStore
+ val release = CompletableDeferred<Unit>()
+ compose.setContent { store = viewModel() }
+ compose.waitUntil { !store.state.value.loading }
+ compose.runOnUiThread {
+ store.mutableState.value = store.state.value.copy(computers = listOf(computer),
+ access = AccessTicket("approved-request", Long.MAX_VALUE, "123456", "replacement", "new-key"),
+ busy = setOf("access"))
+ store.sessionAction { release.await() }
+ store.useApprovedComputer(Computer("replacement", "New computer", "new-key"), "approved-request")
+ // The access polling action ends as soon as the cloud confirms approval.
+ store.mutableState.value = store.state.value.copy(access = null, busy = store.state.value.busy - "access")
+ }
+ compose.runOnIdle {
+ assertEquals("approved-request", store.state.value.approvedAccess["replacement"])
+ assertEquals(computer, store.state.value.computers.single())
+ }
+ // Retire this test's generation so releasing the queue cannot persist a pairing.
+ compose.runOnUiThread {
+ store.mutableState.value = store.state.value.copy(generation = store.state.value.generation + 1)
+ release.complete(Unit)
+ }
+ compose.waitUntil { "session" !in store.state.value.busy }
+ }
+
private fun snapshot(name: String) {
if (InstrumentationRegistry.getArguments().getString("layoutSnapshots") != "true") return
val bitmap = compose.onRoot().captureToImage().asAndroidBitmap()
diff --git a/apps/android/app/src/main/kotlin/com/codync/android/AppStoreAccount.kt b/apps/android/app/src/main/kotlin/com/codync/android/AppStoreAccount.kt
index ded3e2aa..559d2822 100644
--- a/apps/android/app/src/main/kotlin/com/codync/android/AppStoreAccount.kt
+++ b/apps/android/app/src/main/kotlin/com/codync/android/AppStoreAccount.kt
@@ -114,7 +114,9 @@ private suspend fun AppStore.askForAccess(target: CloudComputer, renew: Boolean)
}
/** Switch only after approval, retiring the old channel and its writers before replacing its mirror. */
-private fun AppStore.useApprovedComputer(computer: Computer, requestId: String) {
+internal fun AppStore.useApprovedComputer(computer: Computer, requestId: String) {
+ // Approval is already confirmed by the cloud, even when switching must wait.
+ mutableState.update { it.copy(approvedAccess = it.approvedAccess + (computer.id to requestId)) }
val contextId = state.value.contextId
val generation = state.value.generation
sessionAction(wait = true) {
diff --git a/docs/plans/2026-10-22-ui-and-device-access.md b/docs/plans/2026-10-22-ui-and-device-access.md
index d8ac37a6..19646d55 100644
--- a/docs/plans/2026-10-22-ui-and-device-access.md
+++ b/docs/plans/2026-10-22-ui-and-device-access.md
@@ -172,3 +172,18 @@ successfully. Card polish commit is `27662acc`; #194 is still open, so the separ
mascot/access/card source commits remain local pending the coordinated release.
The main thinking-review Electron/Vite/host and temporary simulators were stopped;
the held mascot worktree's development app remains available until its push.
+
+## CI and release handoff (2026-10-23)
+
+- #194 merged as `4f18c688` after every CI check (including notarization) and
+ Greptile passed, with all review threads resolved.
+- Version 2.22.1 is aligned across iOS, host and desktop. The complete UI work is
+ pushed to dev and release PR #195, with phone-card screenshots in the PR.
+- PR review identified Android approval being hidden while a session handoff waits.
+ The confirmed cloud approval is now recorded before queuing; it is restored after
+ context loading as before. Three narrow after-change reviews found no new defects.
+ Android unit/build/lint checks and three emulator regression cases pass, including
+ the real handoff function blocked behind a busy session and request-specific UI
+ success. This is Android's queued context handoff; iOS awaits its own transition.
+- A memory-layer fullness finding from the pre-#194 comparison is being checked by
+ the original memory owner before #195 merges. CI/review are not bypassed.