Repository navigation
test(browser): preserve page URL during subresource redirects - #2885
zhangguiping-xydt wants to merge 4 commits into
Conversation
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. |
|
7c39cef to
e442cc6
Compare
e442cc6 to
fd815a9
Compare
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
CI-fix track: the shard 4 and Portable failure ( |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
@codex review |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Closing this standalone test follow-up after the original redirect runtime fix landed on main in b98be54. The remaining diff is one assertion that Fetch/Script redirects preserve the page final_url. That additional coverage remains useful; we are retiring this PR to prioritize the remaining contributions. |
|
Thanks, @zhangguiping-xydt, for isolating the subresource-redirect case that must preserve the approved page URL while an out-of-scope main-frame redirect remains unknown. Main now latches the exclusion and tests both redirect paths (main). |
What Problem This Solves
Refs #2593. Browser observation must distinguish a main-frame redirect leaving the approved origins from a cross-origin subresource redirect. The former makes the final page URL unknown; Fetch/Script redirects must preserve the approved page URL.
Why This Change Was Made
Main now includes the original runtime correction in
b98be5408:excludeTargetScope()records exclusion, clearsfinalUrl, and prevents later events or final-frame capture from restoring a stale approved URL. This branch incorporates that implementation and its document-redirect assertions instead of keeping a duplicate assignment.The final diff against main adds one assertion to the existing Fetch/Script negative controls:
target.final_urlmust equaltarget.initial_url. Main-frame exclusion and omitted resource-type cases remain covered by upstream tests. Existing maintainer and PR history is preserved.User Impact
Protects the existing
observe-web-sessionandobserve_web_sessionbehavior: report unknown final locations after scope escape while retaining confirmed page locations after unrelated subresource redirects. No new runtime, schema, dependency, authority or release changes.Evidence
Current commit:
9b4e5f43a3b0d3400b1baa6fa660f53ff769e15b. Integrated main:29d3dcb7ea85b3be37cd81e977ae4e09cebdd2fc. Linux x64, Node.js 24.18.0/npm 11.16.0, real Chrome 138.0.7204.157.npm run check:fast: passed./appon127.0.0.1, then returns HTTP 302 to/outsideon excludedlocalhost. Both adapters returntarget_left_scope,final_url: null, and a redirect event whose excluded URL remains omitted. An independent browser URL confirms the tab reached/outside.6e25cc3) returned the stale approved/appURL through both adapters. The historical proof is retained; the runtime fix is now supplied by main.Integrated upstream EVM cleanup-ownership and PCAP exact-output/fixture-cleanup repairs (
07540cbcd,1341e8c83) that caused the latest CI failures on the companion branches. Their shared source passed the focused EVM/PCAP suites on the same integrated main; this is boundary coverage, not a claim of real EVM/PCAP provider verification.Verification limits
Current-head CI run 38528150551 passed, including Source tests, Static checks, Build package, all five test shards, Portable tests and CI required. Conventional PR title and Greptile Review also passed. The current head is mergeable. Earlier-head checks remain historical evidence. The local Chrome 138 full-browser lane has an isolated-context origin/storage-seeding limitation; the targeted redirect proof above passes. Other operating systems and Chrome versions were not exercised locally. CI gates and assertions have not been weakened.