Skip to content

fix(cdp): don't report an answered navigation as failed when the socket drops - #565

Open
bevelbyte wants to merge 1 commit into
zhom:mainfrom
bevelbyte:fix/cdp-navigation-race
Open

fix(cdp): don't report an answered navigation as failed when the socket drops#565
bevelbyte wants to merge 1 commit into
zhom:mainfrom
bevelbyte:fix/cdp-navigation-race

Conversation

@bevelbyte

Copy link
Copy Markdown

A fast navigation can close the CDP websocket before the navigation response is observed. Donut can then report:

-32000 "no response received from CDP (connection closed)"

even though the navigation already succeeded. This causes a false navigation error and can break flows that issue the next command immediately after navigation.

Which issue does this PR fix?

No existing issue. I found a minor bug while I was using the CDP automation tools.

How to test

1 .Run:
cargo test --lib

This includes the new regression tests for:

  • a connection dropping after the navigation response
  • a connection dropping before the response
  • a browser-reported navigation error
  • a successful command with no load event

2 .Manual: launch a profile and navigate between pages quickly. Before the fix, this could sometimes report a false "connection closed" error even though the page had loaded. After the fix, the command result is preserved.

The focused CDP tests pass (22/22), and the full Rust library test suite passes (731/731).

Checklist

(Note: I had some unrelated pnpm spawn and Biome CRLF failures on my local Windows setup, but cargo clippy and the focused Rust tests are green. CI should pass fine).

AI usage (required)

  • I did not use AI for any part of this PR
  • I used AI, and here is what it did: It helped explain the codebase, draft the Rust fix and regression tests. Then I reviewed and tested them locally.

@zhom
zhom self-requested a review August 16, 2026 19:07
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