Repository navigation
fix(browser): disclose opaque redirect coverage gaps - #7943
Merged
Merged
Conversation
Contributor
[Medium impact] The PR appears safe to merge; it reports missing evidence without changing request behavior. SummaryThe PR reports uncertainty when a request step receives an opaque redirect instead of promising that its status and
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["Page fetch returns opaqueredirect"] --> B["Request owner calls onOpaqueRedirect"]
B --> C{"Network capture selected and collector unsealed?"}
C -->|Yes| D["Collector records coverage limitation"]
C -->|No| E["No added event limitation"]
B --> F["Request step fails without following redirect"]
D --> G["Existing completeness owner marks events missing"]
Reviews (1) · Last reviewed commit: "fix(browser): disclose opaque redirect c..." · Reviewed by Greptile |
morluto
marked this pull request as ready for review
October 28, 2026 23:24
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
16 of 22 tasks
2 tasks done
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
Related to #7410. An opaque manual redirect can omit its response from Playwright network events while the step error promises that the capture contains its Location and event coverage appears complete. The capture now reports the uncertainty and marks selected event coverage incomplete.
Problem and expected behavior
An HTTP 302 answer to a request step is not followed. In the observed Chromium case, Playwright exposes
opaqueredirectto the page and emitsrequestfailedwithout a response event. The step must not claim to have captured a Location or offer complete event coverage when that response may be absent.Change and scope
Propagate opaque-redirect observation from the request owner to the event collector. When network capture is selected, add a coverage limitation; use the existing shared completeness owner to mark events missing. Correct the step error and scenario guide. The redirect response is not recovered: #7410 remains open.
The Playwright public Request does not expose its CDP request ID. A direct
request.response()probe returned null;route.fetch()makes a separate HTTP request. This change does not infer identity from URL or method or issue another request.Contract and boundary impact
Expected effects:
Evidence and regression coverage
A source-CLI replay against loopback and a real Chrome browser returned a failed request step,
missing_sectionsincludingevents, an opaque-redirect limitation, zero destination hits, andterminated-owned-processcleanup. Its transaction contained request, request-content and request-failed events, with no response. Tests cover request callback and network-selected versus unselected event coverage.The status and Location remain unavailable, and no real connected-browser or MCP workflow was verified. The gap is conservatively reported even if a browser happens to expose a response; the implementation does not claim a specific transaction was omitted.
Validation performed
npm run test:local -- src/browser/PlaywrightScenarioRequest.test.ts src/browser/PlaywrightScenarioEvents.sharedContext.test.ts src/browser/PlaywrightScenarioSession.test.ts src/browser/PlaywrightBrowserScenarioProvider.test.ts— 195 passed.npm run check:fast— passed.git diff --check— passed.Compatibility, safety, and release
No schema migration. Consumers can see incomplete event coverage where it was previously reported complete. Real connected-browser, MCP, other browser versions and write-method redirects remain unverified.
Author readiness
Human owner: @morluto
Before merge
type(scope): outcome.