From e5dab605481b87f00fab3b11f61965e21fb9ad50 Mon Sep 17 00:00:00 2001 From: DoodleBear Date: Fri, 23 Oct 2026 03:51:48 +0900 Subject: [PATCH 1/3] fix(mobile): confirm account actions and clean owned connections Issue: #2603 Agent-Task: codex/local/01a164b0-214b-7371-bf06-ca7c00c54137 --- apps/mobile/app/qa/account-actions.tsx | 61 ++++ .../mobile/src/host/account-action-fixture.ts | 150 +++++++++ apps/mobile/src/host/account-connections.ts | 29 ++ apps/mobile/src/host/account-owner.ts | 34 ++ apps/mobile/src/host/connect-account.ts | 229 ++++++++++--- apps/mobile/src/host/host-session.ts | 110 ++++-- apps/mobile/src/host/hosts.ts | 32 +- .../mobile/src/host/native-connect-account.ts | 2 + apps/mobile/src/host/saved-host.ts | 8 +- apps/mobile/src/telemetry/schema.ts | 10 + apps/mobile/src/ui/account-hosts.tsx | 60 ++-- apps/mobile/src/ui/shell/use-pairing.ts | 10 +- apps/mobile/src/ui/strings.ts | 33 +- apps/mobile/test/account-actions.test.ts | 315 ++++++++++++++++++ apps/mobile/test/account-hosts.test.tsx | 93 +++++- apps/mobile/test/connect-account.test.ts | 20 +- apps/mobile/test/host-session-unpair.test.ts | 30 +- changes/2603-account-action-confirmation.md | 11 + ...aches-the-host-through-a-managed-tunnel.md | 12 + docs/architecture/botharness-architecture.md | 6 + 20 files changed, 1131 insertions(+), 124 deletions(-) create mode 100644 apps/mobile/app/qa/account-actions.tsx create mode 100644 apps/mobile/src/host/account-action-fixture.ts create mode 100644 apps/mobile/src/host/account-connections.ts create mode 100644 apps/mobile/src/host/account-owner.ts create mode 100644 apps/mobile/test/account-actions.test.ts create mode 100644 changes/2603-account-action-confirmation.md diff --git a/apps/mobile/app/qa/account-actions.tsx b/apps/mobile/app/qa/account-actions.tsx new file mode 100644 index 0000000000..e450c7890f --- /dev/null +++ b/apps/mobile/app/qa/account-actions.tsx @@ -0,0 +1,61 @@ +import * as Application from 'expo-application'; +import { Redirect, Stack, useLocalSearchParams } from 'expo-router'; +import { useMemo, useState, useSyncExternalStore } from 'react'; +import { ScrollView, View } from 'react-native'; +import { + createAccountActionFixture, + type AccountFixtureScenario, +} from '../../src/host/account-action-fixture'; +import { AccountHosts } from '../../src/ui/account-hosts'; +import { Button } from '../../src/ui/primitives/button'; +import { Text } from '../../src/ui/primitives/text'; +import { space } from '../../src/ui/design/tokens'; +import { t } from '../../src/ui/strings'; + +export default function AccountActionsFixtureRoute() { + if (!__DEV__ || !Application.applicationId?.endsWith('.dev')) return ; + return ; +} + +function AccountActionsFixture() { + const params = useLocalSearchParams<{ scenario?: string }>(); + const scenarios: AccountFixtureScenario[] = [ + 'success', + 'delete-partial', + 'local-write', + 'session-write', + 'expired-retry', + ]; + const scenario = scenarios.find((value) => value === params.scenario) ?? 'success'; + const [reset, setReset] = useState(0); + const fixture = useMemo(() => createAccountActionFixture(scenario), [scenario, reset]); + const snapshot = useSyncExternalStore( + fixture.subscribe, + fixture.getSnapshot, + fixture.getSnapshot, + ); + return ( + + + {}} + /> + + {t.accountFixture.notice} + ) : ( <> -