Skip to content

test(ios): e2e reply context for the relay cooldown test; count wakeup draws - #14555

Merged
teamleaderleo merged 2 commits into
mainfrom
fix/ios-shellui-tests-c
Sep 25, 2026
Merged

teamleaderleo merged 2 commits into
mainfrom
fix/ios-shellui-tests-c

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Sep 25, 2026 •

Copy link
Copy Markdown
Collaborator

Two stale tests in CmuxMobileShellUI and CmuxMobileTerminal.

  • replyRelayDoesNotRepeatRequestInsideServerCooldown was written for the plaintext relay (Fix cross-user Iroh rate-limit starvation #12179). Encrypt push notifications and reply relays end to end #12384 moved SystemReplyRelayClient to /v1/replies/e2e, which returns before any HTTP request unless the reply carries the account, Mac installation and build ids and both keys resolve. The stub saw 0 requests instead of 1. SystemReplyRelayClient gains an internal init taking key material and the pinned-peer lookup (the public init keeps the keychain defaults), and the test uses in-memory keys plus the push context. The test target now depends on CmuxPhonePush.
  • "stale renderer continuations do not follow reused surface addresses" asserted needsDraw stayed false, but the replacement view sets needsDraw itself during startup (geometry sync, first layout). GhosttySurfaceView gets an onDrawForWakeupForTesting hook, same pattern as onFocusInputRequestedForTesting, and both runtime action tests count wakeup draws instead. The stale test also detaches the replacement's own bridge.

Credit: @azooz2003-bit (#12179, #12384) and @lawrencecchen (#9726).

Part of getting the cmux-ios full suite green on main (see #14464 to #14470).

🤖 Generated with Claude Code


Summary by cubic

Fixes two stale iOS tests so the full cmux-ios suite passes on main.

  • replyRelayDoesNotRepeatRequestInsideServerCooldown saw 0 requests instead of 1 because SystemReplyRelayClient now speaks the encrypted /v1/replies/e2e endpoint, which returns before any HTTP request unless the reply carries the account, Mac installation, and build IDs and both keys resolve. The client gains an internal init taking key material and the pinned-peer lookup (the public init keeps keychain defaults), and the test uses in-memory keys plus the full push context; the shell UI test target now depends on CmuxPhonePush.
  • The Ghostty runtime action tests asserted needsDraw stayed false, but the replacement view also sets needsDraw during its own startup. They now count wakeup draws via a new onDrawForWakeupForTesting hook, and the stale-surface test detaches the replacement's own bridge so only a surface-address lookup could reach it.

Written for commit b3cb941. Summary will update on new commits.

Review in cubic

teamleaderleo and others added 2 commits September 25, 2026 06:03
replyRelayDoesNotRepeatRequestInsideServerCooldown was written for the
plaintext relay (#12179). #12384 moved SystemReplyRelayClient to the
encrypted /v1/replies/e2e endpoint, which returns false before any HTTP
request unless the reply carries accountID, macInstallationID and
macBuildID and the phone and pinned Mac keys resolve. The test's reply
had none of these, so the stub URLProtocol saw 0 requests instead of 1.

Add an internal init that takes the phone key material and the pinned
peer lookup (the public init keeps the keychain-backed defaults), and
give the test in-memory keys plus the push context so the first call
reaches the 429 stub and the second is held by the Retry-After gate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
"stale renderer continuations do not follow reused surface addresses"
asserted that the replacement view's needsDraw stayed false after a
stale GHOSTTY_ACTION_RENDER continuation. The render handler already
routes through the source surface's bridge, which the test detaches, so
the continuation is a no-op. But needsDraw is also set by the
replacement view's own startup: didMoveToWindow runs a geometry sync
whose result is applied on a later main-actor turn, and the first
layoutSubviews pass (402x700 against a .zero last size) calls
setNeedsGeometrySync. Both land during the test's Task.yield loop, so
the expectation failed without any stale draw reaching the view.

Add an onDrawForWakeupForTesting hook (same pattern as
onFocusInputRequestedForTesting) and count wakeup draws instead. The
stale test also detaches the replacement's own bridge so only a lookup
by surface address could reach it. The positive test counts the same
hook, since needsDraw let it pass without the action being delivered.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 25, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 10 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository: manaflow-ai/cmux/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: ab4a582f-1b9c-4b88-b6ca-9c785a9edf51

📥 Commits

Reviewing files that changed from the base of the PR and between f2550c9 and b3cb941.

📒 Files selected for processing (5)
  • Packages/iOS/CmuxMobileShellUI/Package.swift
  • Packages/iOS/CmuxMobileShellUI/Sources/CmuxMobileShellUI/ReplyRelayClient.swift
  • Packages/iOS/CmuxMobileShellUI/Tests/CmuxMobileShellUITests/MobilePushReplyBackgroundLaneTests.swift
  • Packages/iOS/CmuxMobileTerminal/Sources/CmuxMobileTerminal/GhosttySurfaceView.swift
  • Packages/iOS/CmuxMobileTerminal/Tests/CmuxMobileTerminalTests/GhosttyRuntimeActionTests.swift

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@teamleaderleo
teamleaderleo merged commit 64b150b into main Sep 25, 2026
53 of 55 checks passed
@teamleaderleo
teamleaderleo deleted the fix/ios-shellui-tests-c branch September 25, 2026 11:39
@github-actions

Copy link
Copy Markdown
Contributor

Merge receipt for b3cb941057, merged 2026-09-25 11:39:31 UTC

  • Not verified at merge: ios-simulator-build (in progress), mobile-core-package (in progress)
  • Verified: ci-status, Web complexity, web-validation, detect-ios-changes, Fast static checks, guards (17), package-conventions-lint, runner, Testbox broker trust boundary, tests
  • Skipped by policy: browser, Claude wrapper regressions, GhosttyKit release check, linux-preflight, macos, macOS admission gate, remote-daemon, suite-coverage, web, web-build, web-database-tests, web-tests
  • Full suite: runs on main after merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant