iter-138: navigation truthfulness II — HTTP status, SPA history, honest timeouts - #177
Merged
Merged
Conversation
…honest timeouts Fixes the iter-130 regression where back/forward/reload hard-failed with a Timeout when traversing a same-document history entry (SPA pushState/popstate, or a same-page fragment navigate) — Firefox never fires a document-event for these, so the previous commit-wait could never resolve. - Theme A: navigate reports the main document's real HTTP status, sourced by watching network-event resources alongside document-event; works through the default daemon connection via start_daemon_stream/stop_daemon_stream (the daemon manages network-event centrally and doesn't forward it to a plain watchResources subscriber). - Themes B/C: detect completed same-document navigation directly (readyState complete + location.href changed) instead of waiting for a document commit that will never arrive. - Theme D: timeout messages report the real wall-clock elapsed time instead of an internal sub-budget. - Theme E: back/forward/reload gain a real --no-wait escape hatch. - Theme F: back/forward/reload always re-resolve committed_url via a top-level eval instead of trusting a document-event that may belong to a subframe. - Theme G: navigate --with-network no longer drops committed_url/ready_state (and now status too). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
iter-138 found and fixed a bug where taking "most recent update record" instead of "most recent non-null value per field" silently dropped a real HTTP status back to null. perf's Theme B byte attribution reads from the performance-timing API, not the RDP network-event stream iter-138 touched, so this doesn't apply directly — recorded so the next investigator doesn't have to re-derive that check. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
back/forward/reloadno longer hard-fail with aTimeouton same-document history traversal (SPApushState/popstate) — iter-130 gave these commandsnavigate's document-commit wait, but a same-documentpopstatefires no fresh document-commit event, so the wait could never resolve. Same-document completion is now detected directly (readyState complete +location.hrefchanged) via a replay-guarded probe (probe_same_document_commit_safe) instead of waiting for a commit that never arrives.navigatenow reports the main document's real HTTPstatus(404/503 pages previously returned an untruthful success envelope with no way to detect the failure short of a follow-upnetworkcall). Sourced by streamingnetwork-eventviastart_daemon_stream/stop_daemon_streamalongside the existingdocument-eventwait on the default daemon path — the daemon does not forwardnetwork-eventto a plainwatchResourcessubscriber, so this required daemon-stream plumbing, not just a subscribe.#frag) now succeeds instead of burning the full--timeoutand reporting failure (same same-document root cause as Theme B).back/forward/reloadgain a real--no-waitescape hatch — previously recommended in the Theme B/C error text but rejected as an unrecognized argument.back/forward/reloadalways re-resolvecommitted_urlvia a top-leveleval location.hrefinstead of trusting adocument-eventthat may belong to a subframe (fixed a case whereback/forwardreported a cross-origin CDN subframe URL as the result).navigate --with-networkno longer dropscommitted_url/ready_state— both are now present alongside network data (and nowstatustoo).Test plan
cargo fmt— cleancargo clippy --workspace --all-targets -- -D warnings— cleancargo test --workspace -q— 820+ passed, 0 failedFF_RDP_LIVE_TESTS=1 cargo test -p ff-rdp-cli --test live live_138— all 7 live_138_* tests pass against real headless Firefox through the default daemon path (no--no-daemon):live_138_navigate_reports_404live_138_navigate_reports_200live_138_pushstate_back_succeedslive_138_fragment_navigate_succeedslive_138_timeout_message_matches_wall_clocklive_138_back_forward_committed_url_is_top_framelive_138_with_network_keeps_envelopecargo run -p xtask -- check-iteration-ready --plan kb/iterations/iteration-138-navigation-truthfulness-2.md --base origin/main— 10/10 sub-checks PASS🤖 Generated with Claude Code## Claims vs code
<generated 2026-08-10T12:19:47Z by ralph-loop>
the→ ✅ matched in diff