Skip to content

test(ui-e2e): reach the socket commit path in the legacy ACK browser proof (OH-69) - #28

Merged
andorcassian merged 2 commits into
devfrom
feature/OH-69-legacy-ack-browser-proof
Nov 4, 2026
Merged

andorcassian merged 2 commits into
devfrom
feature/OH-69-legacy-ack-browser-proof

Conversation

@andorcassian

@andorcassian andorcassian commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

What changes

The browser test resolves a legacy message ACK through authenticated stored history before and after reload could never reach the code it was written to prove. Its fixture attached CLI 0.2.16, which supports the Pending queue, so immediate send enqueued Pending and the socket message ACK never happened.

  • The fixture's CLI version is now 0.0.9, below the Pending queue minimum, so immediate send takes the direct socket commit path. The server's real pendingVersion is left in place.
  • The test now tells stored time apart from local time. Before, it compared minute-precision text, so a row built from the local send time or from an ACK-time clock passed whenever the send stayed inside one minute. The browser clock now runs three hours behind the server (page.clock.install), so only the stored createdAt renders the expected text, before and after reload. A guard asserts that the skew changes the formatted text. Nothing realigns the skewed clock: nowServerMs() calibrates from the HTTP Date header, and the server's CORS policy does not expose that header to a cross-origin web client.
  • The fixture comment now states the real routing, taken from submitSessionUserMessage. When pendingVersion is numeric, agent_queue enqueues Pending for any CLI at or above the minimum, including explicit immediate send. The socket commit is reached only with a below-minimum CLI, or with a session that has no numeric pendingVersion. The runtime-RPC fallback lives inside sync.sendMessage, which only the direct-send branch reaches, so it is not another route.

Test-only: no production code changes.

Because the spec runs in serial mode, this test failing also skipped the test after it. Both now run.

Validation

  • RED, original spec: failed with page.waitForResponse: Timeout 15000ms exceeded waiting for the by-local-id lookup, with the message held as Message queued in Pending.
  • Proof that the strengthened assertions work: production code was broken twice and restored each time, with the restore checked byte for byte.
    • The committed row built with nowServerMs() in place of the looked-up createdAt failed toHaveText: expected 10:09 AM, received 7:09 AM. A run with the skew applied only through the HTTP Date header passed against this break, which is how the CORS point above was found.
    • Rejecting the lookup after its response failed on the row count (expected 1, received 0).
  • GREEN on the restored code: the focused test passed twice (1 passed each run).
  • packages/tests typecheck: passed.
  • Earlier, on the previous commit: the whole session.actionRail.spec.ts had 2 passed. The unchanged opens independent panes and preserves access across responsive layouts test timed out under heavy machine load and passed alone. Owner tests sync.optimisticThinking.test.ts and submitSessionUserMessage.test.ts had 70 passed. None of this was rerun for this commit, which touches only the first test.

Not run: the full UI e2e suite and apps/ui typecheck (no apps/ui files changed). This ran in Playwright's bundled Chromium on macOS only.

  • Hosted CI — Tests passed on head 5046d62 (UI E2E shards, typecheck, unit suites). No Copilot review arrived within 15 minutes of marking ready.

Scope and deferrals

  • The supported old-ACK gate is still open. This browser proof uses a CLI version below the supported minimum, which the UI flags as CLI Update Required, and no released CLI is known to report 0.0.9. On server-v0.2.17, which projects pendingVersion, no supported CLI reaches the socket ACK or the by-local-id lookup. Every send there goes through Pending. The other route, a session without a numeric pendingVersion, is not produced by any server in this history that also serves by-local-id. Whether a below-minimum-CLI proof is acceptable, or the lookup belongs only to that state, is a product and compatibility decision.
  • The old server is emulated by removing createdAt from the ACK frame. Hosted proof against a real older relay remains open.
  • One after-reload screenshot from an earlier whole-spec run on a loaded machine caught a placeholder frame after the assertions had passed. A probe did not reproduce it, and the cause is unknown.
  • 0.3 port disposition is blocked because the destination checkout is absent.
  • Native QA deferred.

Tracks OH-69.

…proof

The fixture attached a 0.2.16 CLI, which supports the Pending queue, so
immediate send enqueued Pending and never received the socket ACK this
test emulates. Attach a CLI below the Pending queue minimum instead, and
correct the comment that claimed otherwise.

Tracks OH-69.
The proof compared minute-precision text, so a row built from the local
send time or an ACK-time clock passed whenever the send stayed inside one
minute. Run the browser clock three hours behind the server so only the
stored createdAt renders the expected time, and guard that the skew
changes the formatted text.

Correct the fixture comment: with a numeric pendingVersion, a CLI at or
above the Pending queue minimum always enqueues Pending, so the socket
commit is reached only by a below-minimum CLI or a session without a
numeric pendingVersion.

Tracks OH-69.
@andorcassian
andorcassian marked this pull request as ready for review November 4, 2026 18:45
@andorcassian
andorcassian merged commit 18d9f67 into dev Nov 4, 2026
41 checks passed
@andorcassian
andorcassian deleted the feature/OH-69-legacy-ack-browser-proof branch November 4, 2026 19:01
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