Files
t3code/apps/mobile
b603bacfd0 fix(mobile): probe on network path changes, report leases on reconnect
Rebuilt on main after #5561 and #5404 landed overlapping reconnect
work. What main already covers is dropped from this branch: the backoff
ladder rework replaces our jitter, wakeProbeFailed replaces our
probe-failure fast path, and the authoritative-session guard replaces
our shell warm-cache short-circuit.

What remains is the mobile-specific delta:

- New advisory `network-path-changed` wakeup: WiFi<->cellular keeps
  isConnected true while invalidating the socket's path, so the mobile
  adapter emits a wakeup on interface-type changes while active and the
  supervisor probes the session (3s bound) instead of waiting for the
  ping timeout. A failed probe rides main's wakeProbeFailed fast path;
  flapping interfaces cannot cut backoff delays short.
- Client activity is re-reported on every newly connected session
  generation; the AppState-triggered report races the reconnect and is
  dropped, leaving provider/VCS work paused server-side for up to 25s
  after a resume. Generation dedup is per-supervisor since replacements
  restart the counter.
- The RPC onPingTimeout hook is wired to logging so zombie-socket
  disconnects are distinguishable from ordinary closes.
- Server websocket idleTimeout drops to 30s from Bun's 120s default
  (clients ping every 5s, so live connections never idle), releasing a
  suspended phone's half-dead socket and buffers four times sooner.

Co-Authored-By: Claude Fable 5 <[email protected]>
Co-authored-by: codex <[email protected]>
2026-08-10 12:58:27 +02:00
..
2026-05-29 17:00:54 -07:00
2026-05-29 17:00:54 -07:00
2026-06-03 22:08:34 -07:00
2026-05-29 17:00:54 -07:00
2026-05-29 17:00:54 -07:00
2026-05-29 17:00:54 -07:00
2026-05-29 17:00:54 -07:00
2026-05-29 17:00:54 -07:00
2026-05-29 17:00:54 -07:00

T3 Code Mobile

Warning

T3 Code Mobile is currently in development and is not distributed yet. If you want to try it out, you can build it from source.

Quickstart

Note

Uses native modules so using Expo Go is not supported. You need to use the Expo Dev Client.

This app has three variants:

  • development: Expo dev client, installable side-by-side as T3 Code Dev
  • preview: persistent internal preview build, installable side-by-side as T3 Code Preview
  • production: store/release build as T3 Code

Run commands from apps/mobile.

T3 Connect is optional and disabled in a fresh clone. Public configuration belongs in the repository-root .env or .env.local, not an apps/mobile/.env file. See ../../.env.example.

Development

Start Metro for the dev client:

vp run dev:client

Build and run the local iOS dev client:

vp run ios:dev

If your Xcode account only has a Personal Team, use a bundle identifier you control and opt into the reduced-capability local build. Personal Team builds omit the widget and share extensions, push entitlement, and native Sign in with Apple entitlement; builds without this opt-in are unchanged.

T3CODE_IOS_PERSONAL_TEAM=1 \
T3CODE_IOS_PERSONAL_TEAM_BUNDLE_ID=com.example.t3code.dev \
vp run ios:dev

Build and install a self-contained Release app that does not need Metro:

vp run ios:release

The Personal Team equivalent also needs a unique bundle identifier:

T3CODE_IOS_PERSONAL_TEAM=1 \
T3CODE_IOS_PERSONAL_TEAM_BUNDLE_ID=com.example.t3code \
vp run ios:release

Build and run the local iOS preview app:

vp run ios:preview

Force the review diff highlighter engine:

EXPO_PUBLIC_REVIEW_HIGHLIGHTER_ENGINE=javascript vp run ios:dev

javascript is the default and recommended setting for the review diff screen. Set EXPO_PUBLIC_REVIEW_HIGHLIGHTER_ENGINE=native only when you explicitly want to test the native Shiki engine.

Inspect the resolved Expo config for a variant:

vp run config:dev
vp run config:preview

Run static checks for mobile native code:

node ../../scripts/mobile-native-static-check.ts

The native lint task runs SwiftLint for Swift plus ktlint and detekt for Kotlin. Missing native tools are reported as warnings and skipped locally. CI installs the default toolset from apps/mobile/Brewfile before running the native checks.

EAS Builds

CI uses Expo fingerprinting with the preview:dev profile to reuse an existing compatible build when possible, or start a new internal EAS build when native runtime inputs change. Production and default local builds continue to use the appVersion runtime policy.

For preview or production EAS environments, set T3CODE_CLERK_PUBLISHABLE_KEY, T3CODE_CLERK_JWT_TEMPLATE, and T3CODE_RELAY_URL as EAS environment variables. Expo config maps the canonical values into the mobile build.

Create a PR preview dev-client build manually:

vp run eas:ios:preview:dev

Create a cloud dev-client build:

vp run eas:ios:dev

Create a persistent preview build:

vp run eas:ios:preview

Android equivalents:

vp run eas:android:dev
vp run eas:android:preview:dev
vp run eas:android:preview