Files
wodify-cli/tests
lucioandClaude Opus 5 06122c66dd fix: single-reader CDP session; prime walk no longer fails silently
prime ran the in-page click walk as a task while drain() also read the
websocket. `websockets` forbids concurrent recv(), so this was always broken --
it just failed differently by version: loudly on websockets 15.0.1, and
silently on 16.0, where the JS still executed but its return value was lost.
The `walk: None` in every prime summary was that failure being swallowed by a
bare `except Exception`, and I read past it.

CDPSession now runs exactly one reader coroutine that dispatches command
replies to futures and events to a queue, so call() and drain() can safely run
concurrently -- which priming genuinely needs, since the requests being observed
are triggered by the script being awaited.

call() also gains a timeout so a lost reply fails instead of hanging, and the
walk now reports its error rather than reporting None.

Tests use a fake websocket that asserts the socket never has more than one
concurrent reader.

129 tests, no network required.

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-07-25 09:27:24 -07:00
..