Repository navigation
List each hop of a redirect chain as a network row of its own - #633
Open
vishnuv688 wants to merge 1 commit into
Open
vishnuv688 wants to merge 1 commit into
vishnuv688 wants to merge 1 commit into
Conversation
A redirect re-sends a request under the same BiDi id, and core and the Python adapter rebuilt one row per id, so a form submit showed only the GET it landed on: its POST and the 3xx were lost. Each hop now gets a row whose id is the request id plus its redirectCount, on its own clock, and every answer or failure closes the hop it names by its own count, so hops sent before the previous one is answered still close correctly. A driver that sends no counts keeps one row per chain. The Python copy of the id rule is held equal to core's by the mirror vectors. Closes #630
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
[Medium impact] This PR appears safe to merge. SummaryRedirect hops now get separate network rows in core and the Python adapter.
Acknowledged scope: DiagramsequenceDiagram
participant Browser
participant Capture
participant Rows
Browser->>Capture: POST, request R1, count 0
Capture->>Rows: Open R1
Browser->>Capture: GET, request R1, count 1
Capture->>Rows: "Open R1#1"
Browser->>Capture: 303, request R1, count 0
Capture->>Rows: Close R1
Browser->>Capture: 200, request R1, count 1
Capture->>Rows: "Close R1#1"
Reviews (1) · Last reviewed commit: "List each hop of a redirect chain as a n..." · Reviewed by Greptile |
2 of 18 tasks
This branch has not been deployed
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.
What & why
A redirect re-sends a request under the same BiDi request id, and core's handlers (used by Selenium JS and Nightwatch) and the Python adapter rebuilt one row per id. A login form's submit therefore showed only the page it landed on: the browser sent
POST /authenticate, got 303, then loaded/login, and the trace listed oneGET /login 200. The committed Nightwatch and Python fixtures show it, with no POST in either.Each hop is now a row of its own:
networkRowId(requestId, redirectCount): the request id for the first hop, and the id with BiDi'sredirectCountafter it (R1,R1#1, ...).beforeRequestSent.redirectCount. Hops whose events arrive out of order (the next hop sent before the previous is answered, or Python's per-callback threads reordering them) still close correctly.redirectCountkeeps one row per chain, as before.The Python adapter mirrors the rule as
frames.network_row_id, held equal to core's by a newnetworkRowIdsection inpackages/shared/mirror-vectors.json. The backend merges Python frames by id, so it needs no change.Closes #630
Type of change
Packages touched
shared(types and contracts)core(framework-agnostic capture/reporting)elements(published element/snapshot API:@wdio/elements)service(WebdriverIO adapter)nightwatch-devtools(Nightwatch adapter)selenium-devtools(Selenium adapter)selenium-devtools-py(Selenium Python adapter)backend(server)app(UI)script(page-injected runtime)trace(Trace mode)Also
packages/shared/mirror-vectors.jsonand the mirror runners inselenium-devtoolsandselenium-devtools-py.Capability matrix
packages/conformance/src/features.tsupdated, and tables regenerated withpnpm docs:capabilities, if this adds or changes user-facing behaviourNot applicable: network capture is listed already; this changes which rows a redirect chain produces.
Notes for reviewers
coreand not each adapter: the change is in core's BiDi handlers, which Selenium JS and Nightwatch share; Python cannot import core, so its copy is held equal by the mirror vectors.content-type, so a bare 303 is missing there. That is WebdriverIO service drops network responses that have no content-type #629, stacked on this PR, which reusesnetworkRowIdfor its row ids.content-typeandoriginin Chrome's BiDi event; nothing copies headers across hops. The network-capture rule says so.pnpm test(348 files, 4741 tests),pnpm typecheckand lint (0 errors) pass. Python: 970 passed; the two failures intests/test_instrumentation.py(driver retention) fail the same way onmain.POST /authenticaterow with its 303 in the Network tab.Screenshots / recordings
Not applicable: no UI change.
🤖 Generated with Claude Code