Skip to content

Port AttemptSession.checkpoint and the surface-lifecycle typing/press tests (tester-army/e2e#2283) - #2434

Merged
kblok merged 2 commits into
mainfrom
fix/2358-attempt-session-checkpoint
Nov 29, 2026
Merged

kblok merged 2 commits into
mainfrom
fix/2358-attempt-session-checkpoint

Conversation

@kblok

@kblok kblok commented Nov 29, 2026

Copy link
Copy Markdown
Member

Closes #2358

What

Keyboard typing and character presses now stop when the connection is retired or the browser context is replaced, not only on cancel or deadline. Before, a delayed focus read or CDP session could keep sending keys into a replaced context. Now it fails with NODE_STALE.

Upstream parity

Upstream: e2e-inc/e2e#2283 (commit 5c1839c), AttemptSession.checkpoint / token / check / invalidate.

Upstream Port
generation = {} + invalidate() WebSession._generation + Invalidate() (replaces each _refs.Clear() at a connection/page transition)
token() / check(token) Token() / Check(token) (NODE_STALE when generation changed or attempt ended)
checkpoint(signal, label) Checkpoint(budget, cancellationToken), now also checks the token; shared by typeText and pressCharacter
typeText checkpoints between focus read, select-all, delete, type TypeTextAsync runs as one budgeted input with the same checkpoints

Port-only symbols: none (no AttemptSession type exists; the methods live on WebSession, the port's equivalent owner).

Verdict: complete.

Upstream tests (all in tests/E2E.Tests/SurfaceLifecycle/SurfaceLifecycleTests.cs)

  • sends no key of a character press when its CDP session opens {cancelled | past its deadline | on a replaced context} → Sends_no_key_of_a_character_press_when_its_CDP_session_opens (3 cases)
  • sends a character press as CDP key events once its session opens on the live context → same-named method
  • stops remaining typing after cancellation during {focus|select-all|delete} → Stops_remaining_typing_after_cancellation_during_stage
  • rejects a focus read from a context replaced before typing dispatches → same-named method

They run against Fake<T> Playwright proxies (an ordinary context over a fake page), like upstream's mocked surface.

Not ported

Upstream's browser.keyboard.press fixture stays on raw Playwright (as upstream). The basic-auth test in the same file remains unported, as noted in the class comment (#2311).

Local run: new tests pass. 17 browser-dependent tests fail in this sandbox (Playwright cannot install chromium), unrelated to this change. Real-model tests were not run (no Copilot login here).


Generated by Claude Code

…haracter-press tests (e2e-inc/e2e#2283)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ls2e22SMi19CSWCdhR8ZZQ
@coderabbitai

coderabbitai Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

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

Next included review available in 31 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 2efc907 and 2296895.

Files selected for processing: 3

  • src/E2E/Engine/WebEngine.Tabs.cs
  • src/E2E/Engine/WebEngine.cs
  • tests/E2E.Tests/SurfaceLifecycle/SurfaceLifecycleTests.cs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ls2e22SMi19CSWCdhR8ZZQ

kblok commented Nov 29, 2026

Copy link
Copy Markdown
Member Author

restore-build-test fails on a different unrelated timing-sensitive test each run (LocatorEngine deadline, FixturePool abandoned setup, SecretLedger large-text read, each passing on the others). None touches the checkpoint change, and every other check is green. Re-running once more.


Generated by Claude Code

@kblok
kblok merged commit 2097678 into main Nov 29, 2026
13 of 17 checks passed
@kblok
kblok deleted the fix/2358-attempt-session-checkpoint branch November 29, 2026 13:23
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.

Port AttemptSession.checkpoint and the surface-lifecycle character-press tests (tester-army/e2e#2283)

2 participants