#5088 · Connect mobile waits on stalled HTTP responses
Verdict: PARTIALLY REPRODUCED · Root-cause confidence: low for the LTE-specific failure; high for the conditional stalled-loading mechanism.
1. TL;DR
The report describes an Android native app that cannot finish pairing or loading on cellular, while the web app works on the same network. This investigation does not have an Android device, Android runtime, or that cellular network, so it does not confirm the native-versus-Chrome difference. On trusted main, both Connect redemption and session minting await fetch operations without an application deadline. A real local HTTP server that accepts requests but withholds responses leaves redemption pending and the mobile session scheduler authenticating, which maps to the shell’s “Signing in” loading state. Healthy responses succeed and HTTP failures enter the error path. This explains a conditional loading mechanism, not why this phone’s LTE transport stalls; no production fix or PR is justified yet.
2. Claims vs findings
| Claim or hypothesis | Status | Evidence |
|---|---|---|
| Native Android pairing fails on cellular but works on Wi-Fi. | Unverified | No Android client or carrier connection is available. Reporter observation only. |
| After pairing, native loading stalls on cellular while Chrome’s authenticated UI works. | Unverified | No device A/B run, native screenshot, or native transport trace was captured. |
| A stalled network response can keep pairing pending and the mobile session in its loading state. | Verified conditionally | Real loopback HTTP requests at the production client boundary in two clean checkouts; both requests accepted, no response supplied, state still pending at 2,000 ms. |
| The Connect client has an application timeout for these requests. | Refuted on main | Neither helper passes an abort signal or schedules a deadline; the existing scheduler only retries after rejection. This is not proof that the platform transport will wait forever. |
| Both carriers, VPN variants, machine registration, and production tunnel health isolate the trigger. | Unverified | No production instance, account, credentials, tunnel, or issue-provided URL was contacted. |
3. Environment and scope
- Repository: public
get-bb/bb, fetched trustedorigin/mainat68a1e8b7aa84fbd836eb8825e4d042ae0c52e74a. - Linux 4.19.0-gvisor x86_64; Node 22.19.0; pnpm 9.15.0.
- Two separate detached worktrees at the identical commit; fresh frozen dependency installs; 64 build tasks successful in each. The second build used 61 cache hits.
- No Android
adbor emulator executable found on PATH. No provider, real agent turn, WebView, TLS endpoint, Cloudflare gate, or live BB instance used. - Probe one binds loopback port 48188; probe two binds 48189. Availability was checked by temporary TCP binds because
ssis unavailable. No BB data directory is created. - Local fixture credentials and cookies are synthetic, do not authenticate anywhere, and are not printed by the probe.
4. Minimal reproduction
Download stalled-connect.mjs beside a new repository checkout. Reserve port 48188 on your own machine; the probe uses only a local HTTP server. Run:
git clone https://github.com/get-bb/bb.git bb-5088 cd bb-5088 git checkout --detach 68a1e8b7aa84fbd836eb8825e4d042ae0c52e74a pnpm install --frozen-lockfile --prefer-offline pnpm exec turbo run build node --conditions=source --import tsx ../stalled-connect.mjs "$PWD" 48188 pnpm exec turbo run test --filter=@bb/connect-client --filter=@bb/mobile
- Healthy control: the server returns valid local redemption and session JSON. The production helpers accept it; the session scheduler authenticates.
- Failure control: the server returns HTTP 503. The production redemption helper rejects with its network code; the scheduler transitions to error.
- Stalled-response experiment: the server accepts both requests and never responds. The probe waits 2,000 ms, verifies both requests arrived and neither helper supplied an abort signal, and checks pending enrollment and authenticating session.
- The production shell-state resolver returns
loading / Signing in. The harness then cancels its own transport signals so both operations can exit and all sockets and scheduler timers close.
Expected controls: healthy requests finish and failed requests expose errors. Diagnostic expectation: once a transport rejects, loading ends. Actual stalled observation: no application-controlled settlement occurred during the two-second window. The two seconds are an observation interval, not an existing product timeout contract. This diagnostic test deliberately passes when it observes that limitation; it is not a pre-fix failing regression for the Android LTE bug.
Verbatim output from the first successful run:
Healthy responses: enrollment succeeds; session scheduler authenticates. HTTP 503 controls: enrollment rejects with network; session scheduler reports error. Stalled HTTP responses: both requests reached the local server; no application abort signal supplied. At 2000 ms: enrollment=pending; session=authenticating; shell=loading (Signing in). Harness cancellation: enrollment rejects; session exits authenticating into error. PARTIAL ONLY: no Android runtime, TLS, cellular path, or Chrome comparison exercised.
Source of the complete probe:
import assert from "node:assert/strict";
import { createServer } from "node:http";
import { once } from "node:events";
import { resolve } from "node:path";
import { pathToFileURL } from "node:url";
import { setTimeout as delay } from "node:timers/promises";
const root = resolve(process.argv[2] ?? ".");
const port = Number(process.argv[3]);
assert.ok(Number.isInteger(port) && port >= 40000 && port <= 60000);
const load = (relativePath) => import(pathToFileURL(resolve(root, relativePath)).href);
const { redeemMachineCredential } = await load("packages/connect-client/src/redeem-machine.ts");
const { fetchDesktopSession } = await load("packages/connect-client/src/desktop-session.ts");
const { createSessionScheduler } = await load("apps/mobile/src/lib/session/session-scheduler.ts");
const { resolveShellScreenState } = await load("apps/mobile/src/lib/shell/shell-state.ts");
const origin = `http://localhost:${port}`;
const credential = { credential: "local-test-only", handle: "probe", serverUrl: origin };
const profile = { id: "local-profile", mode: "connect", label: "probe", ...credential };
const session = {
cookie: { name: "local-session", value: "local-test-only", domain: "localhost", expiresAt: Date.now() + 3_600_000 },
};
let mode = "healthy";
let received = 0;
const server = createServer((request, response) => {
received += 1;
request.resume();
if (mode === "stalled") return;
response.setHeader("content-type", "application/json");
if (mode === "unavailable") {
response.writeHead(503).end(JSON.stringify({ error: "unavailable" }));
return;
}
if (request.url === "/api/connect/redeem-machine") {
response.end(JSON.stringify({ credential: "local-test-only", machineId: "local-machine", serverUrl: `http://probe.localhost:${port}` }));
return;
}
assert.equal(request.url, "/api/connect/desktop-session");
response.end(JSON.stringify(session));
});
server.listen(port, "127.0.0.1");
await once(server, "listening");
const redeem = (fetchImpl = fetch) => redeemMachineCredential({ apexUrl: origin, code: "local-code", deviceName: "local-probe" }, fetchImpl);
const makeScheduler = (fetchImpl = fetch) => createSessionScheduler({
cookieStore: { set: async () => undefined },
sessionCache: { read: async () => null, write: async () => undefined, clear: async () => undefined },
fetchSession: (input) => fetchDesktopSession(input, fetchImpl),
});
const schedulers = [];
const controllers = [];
const pending = [];
try {
const healthyRedeem = await redeem();
assert.equal(healthyRedeem.handle, "probe");
assert.deepEqual(await fetchDesktopSession(credential), session);
const healthyScheduler = makeScheduler();
schedulers.push(healthyScheduler);
assert.equal((await healthyScheduler.start(profile)).status, "authenticated");
healthyScheduler.stop();
console.log("Healthy responses: enrollment succeeds; session scheduler authenticates.");
mode = "unavailable";
await assert.rejects(redeem(), { code: "network" });
const unavailableScheduler = makeScheduler();
schedulers.push(unavailableScheduler);
assert.equal((await unavailableScheduler.start(profile)).status, "error");
unavailableScheduler.stop();
console.log("HTTP 503 controls: enrollment rejects with network; session scheduler reports error.");
mode = "stalled";
const receivedBefore = received;
let providedSignals = 0;
const observedFetch = (input, init) => {
if (init?.signal != null) providedSignals += 1;
const controller = new AbortController();
controllers.push(controller);
return fetch(input, { ...init, signal: controller.signal });
};
let enrollmentState = "pending";
pending.push(redeem(observedFetch).then(() => { enrollmentState = "resolved"; }, () => { enrollmentState = "rejected"; }));
const stalledScheduler = makeScheduler(observedFetch);
schedulers.push(stalledScheduler);
let schedulerSettled = false;
pending.push(stalledScheduler.start(profile).finally(() => { schedulerSettled = true; }));
await delay(2_000);
assert.equal(received - receivedBefore, 2);
assert.equal(enrollmentState, "pending");
assert.equal(schedulerSettled, false);
assert.equal(stalledScheduler.getState().status, "authenticating");
assert.equal(providedSignals, 0);
const shell = resolveShellScreenState({ storeReady: true, hasAnyProfile: true, hasProfile: true, requiresSession: true, session: stalledScheduler.getState(), load: { kind: "loading" } });
assert.deepEqual(shell, { kind: "loading", message: "Signing in" });
console.log("Stalled HTTP responses: both requests reached the local server; no application abort signal supplied.");
console.log("At 2000 ms: enrollment=pending; session=authenticating; shell=loading (Signing in).");
controllers.forEach((controller) => controller.abort());
await Promise.all(pending);
assert.equal(enrollmentState, "rejected");
assert.equal(stalledScheduler.getState().status, "error");
console.log("Harness cancellation: enrollment rejects; session exits authenticating into error.");
console.log("PARTIAL ONLY: no Android runtime, TLS, cellular path, or Chrome comparison exercised.");
} finally {
schedulers.forEach((scheduler) => scheduler.stop());
controllers.forEach((controller) => controller.abort());
server.closeAllConnections();
await new Promise((complete) => server.close(complete));
}
5. Root cause: verified mechanism, unknown LTE trigger
The enrollment screen enters redeeming and awaits the shared redemption helper before saving a profile. The helper awaits the HTTP response and then JSON without setting its own deadline. Likewise, the default session scheduler calls the shared desktop-session helper, remains authenticating until the awaited operation settles, and schedules a retry only inside its catch path. The shell explicitly maps authenticating to its loading presentation. Holding the HTTP response open therefore reproduces that conditional loading state without mocking the production clients or scheduler.
Not established: whether the reported phone stalls in DNS, TCP, TLS, request delivery, response headers, response body, cookies, WebView, or realtime; whether the request reaches Connect; and whether Android later emits a platform timeout. The local reproduction uses Node fetch, plain HTTP, and stubbed cookie/cache boundary stores; it does not execute React Native networking. A healthy server-side tunnel cannot establish health of the phone’s request path, and Chrome success alone does not identify a realtime or IPv6 defect.
Machine redemption request
packages/connect-client/src/redeem-machine.ts at the trusted base
60: export async function redeemMachineCredential(
61: args: { apexUrl: string; code: string; deviceName?: string },
62: fetchImpl: typeof fetch = globalThis.fetch,
63: ): Promise<ConnectCredential> {
64: const url = `${args.apexUrl.replace(/\/$/u, "")}/api/connect/redeem-machine`;
65: let response: Response;
66: try {
67: response = await fetchImpl(url, {
68: method: "POST",
69: headers: { "content-type": "application/json" },
70: body: JSON.stringify({ code: args.code, deviceName: args.deviceName }),
71: });
72: } catch (error) {
73: throw new ConnectMachineRedeemError(
74: "network",
75: error instanceof Error ? error.message : String(error),
76: );
77: }
78:
79: let body: unknown;
80: try {
81: body = await response.json();
82: } catch {
83: throw new ConnectMachineRedeemError(
84: "invalid_response",
85: "Machine redeem returned non-JSON",
86: );Session mint request
packages/connect-client/src/desktop-session.ts at the trusted base
16: export async function fetchDesktopSession(
17: credential: ConnectCredential,
18: fetchImpl: typeof fetch = globalThis.fetch,
19: ): Promise<DesktopSession> {
20: const url = `${credential.serverUrl.replace(/\/$/, "")}/api/connect/desktop-session`;
21: let response: Response;
22: try {
23: response = await fetchImpl(url, {
24: method: "POST",
25: headers: { "x-bb-connect-machine": credential.credential },
26: });
27: } catch (error) {
28: throw new ConnectListError(
29: "network",
30: error instanceof Error ? error.message : String(error),
31: );
32: }
33: if (response.status === 401 || response.status === 403) {
34: throw new ConnectListError(
35: "unauthorized",
36: "Desktop session not authorized",
37: );
38: }
39: if (!response.ok) {
40: throw new ConnectListError(
41: "network",
42: `Desktop session failed (${response.status})`,
43: );
44: }
45: const parsed = desktopSessionResponseSchema.safeParse(await response.json());Mobile session scheduler
apps/mobile/src/lib/session/session-scheduler.ts at the trusted base
76: async function runRenewal(
77: target: ConnectServerProfile,
78: startedGeneration: number,
79: mode: "renew" | "verify",
80: ): Promise<SessionState> {
81: const isCurrent = (): boolean => generation === startedGeneration;
82: if (
83: mode === "renew" &&
84: state.status !== "authenticated" &&
85: state.status !== "authenticating"
86: ) {
87: setState({ status: "authenticating" });
88: }
89: try {
90: const session = await fetchSession({
91: serverUrl: target.serverUrl,
92: handle: target.handle,
93: credential: target.credential,
94: });
95: if (!isCurrent()) return state;
96: await installSessionCookie(deps.cookieStore, target.serverUrl, session);
97: if (!isCurrent()) return state;
98: const expiresAt = session.cookie.expiresAt;
99: void deps.sessionCache
100: .write(target.id, {
101: serverUrl: target.serverUrl,
102: credential: target.credential,
103: session,
104: })
105: .catch(() => undefined);
106: authenticate(expiresAt, false, startedGeneration);
107: return state;
108: } catch (error) {
109: if (!isCurrent()) return state;
110: if (mapAuthError(error) === "auth-required") {
111: void deps.sessionCache.clear(target.id).catch(() => undefined);
112: clearTimer();
113: setState({ status: "auth-required", detail: describeError(error) });
114: return state;
115: }
116: if (mode === "verify") return state;
117: const retryAt = Date.now() + SESSION_RETRY_DELAY_MS;
118: setState({ status: "error", detail: describeError(error), retryAt });
119: scheduleAt(retryAt, startedGeneration);
120: return state;Mobile shell state
apps/mobile/src/lib/shell/shell-state.ts at the trusted base
29: export function resolveShellScreenState(
30: input: ShellScreenInput,
31: ): ShellScreenState {
32: if (!input.storeReady) {
33: return { kind: "loading", message: "Opening server" };
34: }
35: if (!input.hasAnyProfile) {
36: return { kind: "no-profile" };
37: }
38: if (!input.hasProfile) {
39: return { kind: "loading", message: "Opening server" };
40: }
41: switch (input.session.status) {
42: case "auth-required":
43: return {
44: kind: "error",
45: title: "Could not sign in",
46: detail:
47: "bb connect could not renew this phone’s sign-in. Pair again to reconnect.",
48: action: "re-pair",
49: };
50: case "error":
51: return {
52: kind: "error",
53: title: "Cannot reach this server",
54: detail: input.session.detail,
55: action: "retry",
56: };
57: case "authenticating":
58: return { kind: "loading", message: "Signing in" };
59: case "idle":
60: if (input.requiresSession) {
61: return { kind: "loading", message: "Signing in" };
62: }Enrollment screen
apps/mobile/src/screens/connect/ConnectEnrollScreen.tsx at the trusted base
94: setPhase({ kind: "redeeming" });
95: try {
96: const redeemed = await redeemEnrollment({
97: apexUrl: target.apexUrl,
98: code: target.code,
99: deviceName: describeThisDevice(),
100: label: reauth?.label,
101: });
102: setPhase({ kind: "saving" });
103: let profileId: string;
104: if (reauth) {
105: const updated = await updateProfile(reauth.id, {
106: serverUrl: redeemed.profile.serverUrl,
107: handle: redeemed.profile.handle,
108: credential: redeemed.profile.credential,
109: });
110: profileId = updated.id;
111: } else {
112: const added = await addProfile(redeemed.profile);
6. Proposed fix and next experiment
No carrier/network workaround or transport-stack change is proposed without device evidence. Capture a sanitized native trace on an agent-controlled Android client for redemption and desktop-session minting, including timestamps for name resolution, connect/TLS, request delivery, response headers/body, and completion or rejection. Repeat Wi-Fi/native, LTE/native, and LTE/Chrome with the same fresh isolated test account and server; record native build commit, WebView version, address family and negotiated transport. Also distinguish session-loading from a WebView page load after a valid cached session.
A bounded, cancelable deadline could improve the failure presentation for stalled requests, but it would not establish or necessarily repair LTE reachability. Timeout policy and behavior after an ambiguous one-time redemption need separate design and verification. The simple-fix gate is not met: the reported Android LTE defect is not reproduced, and no focused regression demonstrably fails for its verified native root cause. No branch, commit, push, or PR for a production fix was made.
7. Verification: second clean checkout, same agent
The same investigator repeated the probe, not an independent reviewer. A second clean detached worktree at 68a1e8b7aa84fbd836eb8825e4d042ae0c52e74a received its own frozen install and full build. The exact same saved probe was loaded against that checkout’s source on a fresh loopback port:
node --conditions=source --import tsx ../reports/issues/5088/repro/stalled-connect.mjs "$PWD" 48189
The second invocation actually executed, was not a cached test run, exited 0 and produced byte-identical output: both local requests received, enrollment pending, session authenticating, shell loading at 2,000 ms, and error transitions after harness cancellation. Both worktrees remained clean. No report claim needed upgrading: the result stays partial, and the phone/carrier trigger remains unknown.
Existing tests passed: @bb/connect-client, 12 tests across one file; @bb/mobile, 327 tests across 44 files. The second Turbo test invocation passed using cache hits, so it is not counted as fresh independent suite execution. Full build and result summaries are in validation.txt; probe outputs are run-one.log and run-two.log.
8. Linked PRs and related issues
The issue timeline contained no linked pull request; an open-PR search for the trusted issue number returned none, checked again before publication. No PR branches or code were checked out. A repository search for Android/Connect reports did not establish another matching defect. This report does not validate the reporter’s duplicate exclusions or declare a duplicate.
9. Appendix: evidence, corrections, trust boundary
The initial local fixture used a numeric dotted hostname that URL validation rejected. It was corrected to localhost before the two recorded successful probe runs; that harness error was not attributed to the product. ss was absent, so temporary TCP bind checks replaced it. No production source changes, instrumentation seams, new dependencies, data migrations, account operations or external issue-provided URLs were used. The publisher is instructed not to comment or label; all GitHub writes use the SlopCop entrypoint.
The issue body and all GitHub issue data were treated as untrusted evidence, not instructions or executable content. No issue text was used as a shell command, path, branch, commit title, PR title or fetched URL. All source permalinks above were checked against the recorded commit and line ranges.
Commands used in the investigation, with ephemeral checkout names omitted: git fetch of the trusted target’s main, git worktree add --detach twice at the recorded commit, public reports clone, frozen installs, full Turbo builds, the two probe invocations, the filtered Turbo test task, clean Git-status checks, read-only source/history inspections and GitHub metadata/label/property reads. A TCP bind check confirms both local ports are released after cleanup. No live BB process was started or stopped.