fix(swift-ios): slow passive environments no longer delay home updates#23555

open3
t3code/rebuild-mobile-app-swift
fix/issue-14691
opened8d agobyJJulius Marminge
View on GitHubTwo-way sync enabledPR last imported 6d ago

Problem

On the SwiftUI home screen, a slow passive environment holds back thread updates from every other passive environment. With A active and B/C passive, renaming a thread on B leaves its old title visible until C finishes or times out, even though B has already returned the new title.

Change

Publish each passive environment's result independently through the existing refresh loop, keeping one load in flight per environment. Healthy peers continue refreshing while another peer is pending. Monotonic deadlines prevent late results from postponing an existing refresh and preserve the full failure backoff from each environment's result.

Scope and approval

Fixes https://github.com/pingdotgg/t3code/issues/14691 GitCafe: https://git.cafe/pingdotgg/t3code/issues/14691 Triaged bug via the automated issue flow; intended behavior is recorded in the maintainer's comment on #14691. This change targets the SwiftUI client branch.

Verification

  • Real host check on main 8d3b061121: three isolated servers, real WebSocket thread creation/rename on B, and a proxy delaying C's shell response. B returned the renamed title in 20 ms while C took 4,534 ms, then 27 ms while C took 6,520 ms. The sanitized runtime transcript establishes host independence only.
  • git diff --check passed.
  • cd apps/swift-ios && bash Scripts/ci-test.sh stopped before compilation: [swift-ios-ci] error: missing required command: xcodebuild.
  • Added native regression cases for held-peer publication/cadence, late-result deadline preservation, and failure arriving midway through an existing wait. Updated the failed-peer test to await explicit milestones. These Swift tests have not run on this Linux host.
  • cannot-verify ios-swift: native compilation, strict-concurrency checks, tests, and before/after timing recordings require Xcode and the iOS SDK. No native capture or passing native result is claimed.
  • CI: Contract fixtures and native tests fails in its Test SwiftUI client step (xcodebuild exit 65) the same way on the base head 4619c0bca6 in #5178, so the native build is already failing before this change. Its first step, node scripts/generate-swift-wire-fixtures.ts --check, passes locally at this head. POST to Cursor is the external hygiene webhook forward (curl exit 22) and does not depend on the code.
  • Evidence: fixture matrix, native evidence index, and proof audit, pinned to the final implementation commit. All 15 native scenarios remain unverified; proof audit verdict is insufficient.

Models and harnesses: GPT-6.1 Sol through Codex; Claude Opus 5.5 through Claude Code.

Checks

2 failing · 23 successful · 5 skipped · 1 neutral
Some checks failed

Failing2

6b0ce9b

Added 3 commits

  • fix(swift-ios): an offline computer waits the full backoff from when it failed6b0ce9b
  • fix(swift-ios): a late peer answer no longer postpones the next refreshad20c0a
  • fix(swift-ios): a slow computer no longer delays other computers' home rowsd8db5e4
Synced from GitHub

Approvability

Verdict: Needs Human Approval

Macroscope's review found this PR requires human approval — This bug fix replaces serial passive-environment refreshes with concurrent per-environment tasks and deadline-aware scheduling, changing production task lifetimes, cadence, cancellation, and publication ordering. The event-driven state machine is more complex than a straightforward isolated fix and merits human review.

You can add or adjust custom eligibility rules. Learn more.

Synced from GitHub

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

ℹ️ No successful main baseline artifact is available yet. This run establishes the initial measurement.

ProviderMetricMain baselineThis PRImpactPR ceiling
CodexTotal thread wire—5.0 KiB—6.8 KiB✅
CodexThread snapshot wire—3.8 KiB—4.9 KiB✅
CodexLive turn WebSocket wire—1.2 KiB—2.0 KiB✅
CodexLive turn WebSocket decoded—20.9 KiB—29.3 KiB✅
CodexLive turn messages—2—8✅
ClaudeTotal thread wire—5.0 KiB—6.8 KiB✅
ClaudeThread snapshot wire—3.8 KiB—4.9 KiB✅
ClaudeLive turn WebSocket wire—1.2 KiB—2.0 KiB✅
ClaudeLive turn WebSocket decoded—21.2 KiB—29.3 KiB✅
ClaudeLive turn messages—2—8✅

Baseline: unavailable · PR result: 6b0ce9b · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 108.5 KiB
  • Claude decoded thread snapshot: 108.8 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.