Skip to content

test(browser) Isolate checks from third-party requests - #287

Merged
tony merged 3 commits into
mainfrom
fix/guide-redirect-readiness
Nov 9, 2026
Merged

tony merged 3 commits into
mainfrom
fix/guide-redirect-readiness

Conversation

@tony

@tony tony commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Isolate every check context from third-party network connections.
  • Replace off-origin images with local SVG fixtures in browser checks.
  • Constrain request decorators to the check server's origin.
  • Exercise held images, redirects, popups, partial streams and context cleanup.

The Ruby legacy guide can reach its article while third-party README badges keep the browser's load event pending. The shared browser factories now own an origin-restricted forwarding proxy per context. Direct foreign images receive local fixtures; other foreign connections are blocked, including redirects and requests dispatched through Playwright decorators. Same-origin scripts, styles and development WebSockets continue to work. Context shutdown also closes the proxy and its connections.

The regression retains load semantics and checks the destination URL, heading, title, production readiness state and visible guide text. Image appearance in these tests uses fixtures; production behavior when a real remote badge fails is tracked separately in #289. This change touches only browser-check scripts and adds no dependency or timeout allowance. The helper is scoped to the local HTTP development/preview servers; broader HTTPS, IPv6 and arbitrary proxy use are unqualified.

This shared assertion affects both the Perl and Clojure integrations (#274, #276). The change is isolated from the Perl integration for independent review and merge.

Measurements

Recorded isolated samples with the same staged Ruby guides, detailed in the shared-loop investigation:

Measurement Main sample Perl integration sample
Cold Ruby overview GET 7.13s 7.34s
Final dev-server RSS 2675 MiB 2716 MiB
Warm redirect 0.30s 0.34s

The separate hosted ECONNRESET cause remains unverified. No timeout or retry allowance changes.

Test plan

  • Reproduce the held-image timeout using the old load assertion on this main-based branch.
  • Pass the same held-image check with document readiness, including browser/server cleanup.
  • Check syntax and whitespace for the changed scripts.
  • Pass workspace lint and type checks.
  • Keep foreign connections at zero through redirects, decorators, context requests and popups in Chromium, Firefox and WebKit.
  • Preserve same-origin scripts, styles, viewport settings and WebSockets.
  • Fail truncated streams promptly and close pending streams during cancellation and context shutdown.
  • Close contexts after policy-registration failures while preserving the original exception.
  • Pass independent source review and the real Ruby ready/visible check.
  • Preserve required-resource appearance failures and Reload recovery.
  • Complete inner-loop qualification.
  • Pass the authoritative combined release audit and automatic preview in Combined release: new ports, badges, keyboard fix, check guard #291.

The existing required-appearance suite passed in 38.84 seconds. The final cross-engine fixture completed in 11.78 seconds; the final fresh-server Ruby check completed in 30.10 seconds. Targeted script lint, syntax and whitespace checks passed in 0.97 seconds. Workspace lint passed in 2.20 seconds and type checks in 49.28 seconds. The local inner loop hit its existing two-second deadline and terminated after 2.78 seconds. That failed timing result remains recorded; full shared CI is pending.

The first full audit exposed an undefined origin variable in the sidebar demo. The correction also fixes the same migration error in the Ruby/Lua and clipboard entrypoints. A browser/node scope preflight now rejects undefined names across the check scripts. The earlier source review missed these bindings; that failure remains recorded.

Correction validation: the new sidebar-admission regression fails on the original code in 0.90s and passes with the network fixture in 3.03s. The scope audit passes in 0.16s. The actual sidebar checker passes 18 mode, viewport and theme combinations in 96.98s including startup and teardown; its captured appearance/fetch diagnostics are retained. A focused --sidebar-demo mode runs that existing checker. Independent scoped review finds no blocking source issue.

Combined release PR #291 contains corrected head a437e971a32fdb36662e921af74ca1ff9d81f393 and the Perl integration. It is the owner-selected full-site gate. The redundant standalone follow-up run was cancelled after checking that ancestry; it is not counted as passing. The maintainer owns readiness, merge and deployment.

why: External README badges can hold the load event after the Ruby
     legacy URL has reached its destination article. The shared
     assertion affects multiple port integrations.
what:
- Check the destination URL, parsed article heading and title
- Hold badge responses in a regression without raising timeouts
- Add the focused --guide-redirect browser mode

Isolated samples with staged Ruby guides compared main 9a01505
with the Perl integration ca13fe5: cold GET 7.13s versus 7.34s,
final server RSS 2675 versus 2716 MiB, and warm redirects 0.30s
versus 0.34s. This sample showed little integration growth; it did
not establish the cause of the separate hosted ECONNRESET.

On this main-based branch, held badge responses reproduce the old
load timeout. Document readiness completes within the existing
deadline. Appearance checks retain their image-completion contract.
@tony tony mentioned this pull request Nov 8, 2026
19 of 20 tasks
@tony

tony commented Nov 8, 2026

Copy link
Copy Markdown
Contributor Author

Independent reproduction from Clojure docs head 277e7f50b, based on 9a01505fc, supports the navigation-readiness repair here.

The Clojure publication audit timed out after 20 seconds at /en/ruby/latest/guides/overview/, waiting for load.

Local Chromium observations with the existing page and checker:

  • The legacy URL reached /en/ruby/latest/guides/getting-started/ and the expected “Getting started” document.
  • A warm request to that destination returned HTTP 200 in 70.9 ms, but a diagnostic waitForLoadState('load') still timed out after 12 seconds. The document remained interactive.
  • At that point, the only outstanding requests were four Shields.io gem-version images: libtmux, libtmux-async, libtmux-mcp, and libtmux-workspace.
  • As a control, aborting only requests to img.shields.io made navigation through the same legacy URL finish at the correct destination with HTTP 200 and document.readyState === 'complete' in 1,041.9 ms. The control still waited for load; it changed no page content or timeout.

This isolates an external image dependency after the redirect has succeeded. Badge rendering remains a separate product decision. The badge-to-text staging workaround has been removed from #276; that PR will rebase onto this fix after it lands.

why: Remote README badges can keep document load pending across browser
checks. Context routing alone misses redirects and can be bypassed by
later request decorators.

what:
- Create shared check contexts with an owned origin-restricted proxy
- Fulfil foreign images locally and constrain existing decorators
- Preserve load and visible-readiness assertions for legacy guides
- Exercise redirects, popups, WebSockets and failed stream cleanup
- Close owned contexts when policy registration fails
@tony tony changed the title test(navigation) Ignore pending badge images test(browser) Isolate checks from third-party requests Nov 8, 2026
why: The shared context factory needs each caller's site URL. Undefined
base variables stopped the sidebar audit and two standalone checks.

what:
- Preserve the sidebar, clipboard and Ruby/Lua URL bindings
- Reject undefined names in browser-check preflight
- Exercise sidebar context admission and add a focused browser mode
tony added a commit that referenced this pull request Nov 8, 2026
why: The Perl agent corrected #287's undefined-base sites and added a preflight and regression test; this branch keeps that one version.

what: Merge #287 at a437e97.
@tony
tony merged commit 8ff08cb into main Nov 9, 2026
1 of 3 checks passed
@tony
tony temporarily deployed to docs-preview-cleanup November 9, 2026 13:38 — with GitHub Actions Inactive
tony added a commit that referenced this pull request Nov 9, 2026
…ts (#291)

why: Six ports had docs branches ready but no published site, and
three shared fixes were waiting behind them. Releasing them together
gives one docs commit to trust for deployment and one set of caller
pins to move, instead of six separate waves.

what:
- Add OCaml (#264), Haskell (#265), Erlang (#266, #278, #279, #280,
  #284, #292), Common Lisp (#268), Perl (#274) and Clojure (#276):
  native API pages, tested guides, navigation, landing and switcher
  entries, and cross-reference data for each
- Keep browser checks from loading third-party resources, and pass
  the check origin to the three scripts that named an undefined base
  (#287)
- Render guide badges at build time instead of hotlinking shields
  (#288)
- Size the reference sidebar and member bars from the viewport, so
  the Chrome iOS keyboard no longer shrinks them (#290)
- Make the OCaml model producer verify its native build inputs in
  their checkout and reject stale ones, with controls run in CI
- Offer one switcher page per port, and title Perl's workspace guide
  "Workspace guide"
- Regenerate the registry, mention index and cross-reference counts
  for the combined port set

Base main 2593131, head dabe59b. Port heads: #264 7d4f88f
and 73fb1ad, #265 dc024e3, #268 947da1f, #274 818fa2e,
#276 a134503, #287 a437e97, #292 e7740d9.

This branch was previously deployed

1 inactive deployment
docs-preview-cleanup — a437e971 Deployed Nov 9, 2026 by tony via cleanup #221
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