Skip to content

[docs] ADR: Supersede 17685 so unscoped network handlers apply to every window - #18279

Open
AutomatedTester wants to merge 7 commits into
trunkfrom
adr-unscoped-handlers-every-window
Open

AutomatedTester wants to merge 7 commits into
trunkfrom
adr-unscoped-handlers-every-window

Conversation

@AutomatedTester

@AutomatedTester AutomatedTester commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

📄 The decision, its rationale, considered options, and consequences are in the record file
this PR adds; read it there. The sections below are proposal notes and review logistics.

🔗 Related

📝 Proposal notes

Accepted records are immutable, so this copies 17685 in full and supersedes it rather than amending it. Compare the two files to see the change. This came out of review on #17681. Only the default changes; scoping by window handle or user context stays as 17685 decided.

🗣 Discussion

  • Should an unscoped handler in a session shared by several workers be called out more strongly? Interception will now pause matching requests in every tab.

Discussed at the TLC meetings below; see the minutes for the full discussion and attribution.

  • 2026-11-12: the global default is a starting point, to revisit if needed; high-level APIs scope by window handle.

📌 Tracking

Tracking issue: (linked on acceptance)


Generated by Claude Code

Proposes replacing 17685 decision 11's default scope so a handler
registered without a window handle or user context applies to every
window, matching 17776 and 17681.
@selenium-ci

Copy link
Copy Markdown
Member

/agentic_describe

@qodo-code-review

qodo-code-review Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. Credentials sent to any challenged host ✓ Resolved

Resolving commit: e059fce

Resolution reason
Replaced the consequence bullet so it explicitly names cross-worker override effects on other
workers' tabs and cross-host credential exposure for URL-pattern-less static credentials, and
advises passing a tab scope.
Description
Under the every-window default (decision 11) and match-all URL default (decision 2), an unscoped
addAuthentication(username, password) with no url_patterns supplies static credentials to every
authentication challenge in every tab, including challenges from unrelated or attacker-controlled
hosts. Likewise, decision 6 and the consequences describe client overrides as 'local', but an
unscoped override registered by one worker applies to every tab in the session, and its submit
short-circuits handlers other workers registered for their own tabs.

2. Old rule retired before its replacement 🐞 Bug ⚙ Maintainability
Description
The status line in 17685 is changed to 'Superseded by 18279', but the new record 18279 is written
with 'Status: Proposed' and will only be accepted later. Once this merges, the network handler
default scope has no accepted decision behind it, and the Python implementation in #18051 is still
built on 17685's current-window rule.
Code

docs/decisions/17685-network-handler-behavior.md[3]

+- Status: Superseded by [18279](18279-network-handler-behavior.md)
Evidence
The PR retires an Accepted record in favor of a Proposed one, so the repository has no accepted
default for network handler scope until 18279 is accepted. The PR description itself says the Python
work in #18051 implements 17685, which is the rule being retired.
Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The PR changes 17685's status to 'Superseded by 18279' while 18279 is still 'Status: Proposed'. Between merge and acceptance the repo has no accepted default scope for network handlers, and the Python implementation in #18051 follows 17685.

## Fix Focus Areas
- docs/decisions/17685-network-handler-behavior.md[3-3]
- docs/decisions/18279-network-handler-behavior.md[3-3]

## Recommended Fix
Revert the status edit in 17685 until 18279 is accepted, and flip 17685 to 'Superseded' in the same change that accepts 18279. Alternatively, state in 18279 that it is a proposal and 17685 remains the operative decision until acceptance.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗



Informational

3. Stall note contradicts default continue ✓ Resolved

Resolving commit: e059fce

Resolution reason
Replaced the ambiguous "intercepts and never lets a request continue" stall consequence with "Each
intercepted request waits for the handler, so a slow or hung handler now holds matching requests
everywhere", clarifying the stall trigger as the handler holding the request rather than
non-settlement.
Description
The consequence says a handler that 'never lets a request continue now stalls those requests
everywhere', but decision 5 says a handler that settles nothing lets the event proceed, so the
record does not define what stalls a request. A reader cannot tell whether a non-settling handler is
harmless or blocks every tab.

Grey Divider

Context sources
✅ Linked PRs:
  🌐 PR #17776
  🌐 PR #17681
  🌐 PR #18051
Review mode: Auto: ⏭️ Skipped: Focused changes are exclusively documentation and a documentation link update.

Grey Divider

Tip of the day
💡 Did you know, you can open the rule or relationship behind a finding in one click

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Previous reviews

Review updated until commit 68daae3 ⏭️ Skipped

Results up to commit 862c60e ⏭️ Skipped


No changes from previous review

Results up to commit 26904d0 ⏭️ Skipped


No changes from previous review

Results up to commit 75080ca ⏭️ Skipped


No changes from previous review

Results up to commit f4c4f76 🚀 Fast


🐞 Bugs (1) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)


Remediation recommended
1. Old rule retired before its replacement 🐞 Bug ⚙ Maintainability
Description
The status line in 17685 is changed to 'Superseded by 18279', but the new record 18279 is written
with 'Status: Proposed' and will only be accepted later. Once this merges, the network handler
default scope has no accepted decision behind it, and the Python implementation in #18051 is still
built on 17685's current-window rule.
Code

docs/decisions/17685-network-handler-behavior.md[3]

+- Status: Superseded by [18279](18279-network-handler-behavior.md)
Evidence
The PR retires an Accepted record in favor of a Proposed one, so the repository has no accepted
default for network handler scope until 18279 is accepted. The PR description itself says the Python
work in #18051 implements 17685, which is the rule being retired.
Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The PR changes 17685's status to 'Superseded by 18279' while 18279 is still 'Status: Proposed'. Between merge and acceptance the repo has no accepted default scope for network handlers, and the Python implementation in #18051 follows 17685.

## Fix Focus Areas
- docs/decisions/17685-network-handler-behavior.md[3-3]
- docs/decisions/18279-network-handler-behavior.md[3-3]

## Recommended Fix
Revert the status edit in 17685 until 18279 is accepted, and flip 17685 to 'Superseded' in the same change that accepts 18279. Alternatively, state in 18279 that it is a proposal and 17685 remains the operative decision until acceptance.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗


2. Credentials sent to any challenged host ✓ Resolved

Resolving commit: e059fce

Resolution reason
Replaced the consequence bullet so it explicitly names cross-worker override effects on other
workers' tabs and cross-host credential exposure for URL-pattern-less static credentials, and
advises passing a tab scope.
Description
Under the every-window default (decision 11) and match-all URL default (decision 2), an unscoped
addAuthentication(username, password) with no url_patterns supplies static credentials to every
authentication challenge in every tab, including challenges from unrelated or attacker-controlled
hosts. Likewise, decision 6 and the consequences describe client overrides as 'local', but an
unscoped override registered by one worker applies to every tab in the session, and its submit
short-circuits handlers other workers registered for their own tabs.


Informational
3. Stall note contradicts default continue ✓ Resolved

Resolving commit: e059fce

Resolution reason
Replaced the ambiguous "intercepts and never lets a request continue" stall consequence with "Each
intercepted request waits for the handler, so a slow or hung handler now holds matching requests
everywhere", clarifying the stall trigger as the handler holding the request rather than
non-settlement.
Description
The consequence says a handler that 'never lets a request continue now stalls those requests
everywhere', but decision 5 says a handler that settles nothing lets the event proceed, so the
record does not define what stalls a request. A reader cannot tell whether a non-settling handler is
harmless or blocks every tab.

Results up to commit e059fce ⏭️ Skipped


No changes from previous review

Results up to commit 0dd59ed ⏭️ Skipped


No changes from previous review

Grey Divider

Qodo Logo

@qodo-code-review

Copy link
Copy Markdown
Contributor

PR Summary by Qodo

Document session-wide default for unscoped network handlers

📝 Documentation 🕐 10-20 Minutes

Grey Divider

AI Description

• Proposes that unscoped network handlers cover every window, including future windows and user
 contexts.
• Preserves explicit window and user-context scoping while superseding only decision 11’s default.
• Explains cross-window interception risks and aligns network handlers with script and window-event
 handlers.
Diagram

graph TD
  R["Register handler"] --> D{"Scope argument?"} -->|none| A["All session windows"]
  D -->|window| W["One window"]
  D -->|user context| C["Context windows"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Keep the registration-window default
  • ➕ Limits interception to one tab without an explicit scope.
  • ➖ Silently misses new windows and gives unscoped network handlers different semantics from script and window-event handlers.
2. Require an explicit scope
  • ➕ Makes the affected windows unambiguous at registration.
  • ➖ Adds friction for single-tab use and still differs from the other unscoped handlers.

Recommendation: Adopt the proposed session-wide default. Explicit window scoping remains available for isolation, while the default avoids silently missing requests and aligns handler families. Reviewers should confirm that the cross-worker interception consequence is prominent enough.

Files changed (1) +63 / -0

Documentation (1) +63 / -0
unscoped-network-handlers-apply-to-every-window.mdPropose session-wide default scope for network handlers +63/-0

Propose session-wide default scope for network handlers

• Adds a proposed decision record replacing the registration-window default in decision 11 of 17685 with coverage of every session window, including future windows. It retains explicit window and user-context scopes, compares rejected alternatives, and documents the impact of interception across shared-session tabs.

docs/decisions/unscoped-network-handlers-apply-to-every-window.md

@qodo-code-review

Copy link
Copy Markdown
Contributor

Code review by qodo was updated up to the latest commit 26904d0

@titusfortner titusfortner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with the content, but the ADR Readme says that ADRs are immutable and must be superseded rather than edited (or updated independently elsewhere). Just Copy/Paste that ADR, make the handful of edits and mark the old ADR superseded.

ADRs are immutable, so 18279 now repeats 17685 in full with one change:
an unscoped handler applies to every window (decision 11, its options
and consequences). 17685's status points to 18279.
@AutomatedTester AutomatedTester changed the title [docs] ADR: An unscoped network handler applies to every window [docs] ADR: Supersede 17685 so unscoped network handlers apply to every window Nov 5, 2026

Copy link
Copy Markdown
Member Author

@titusfortner Done in 75080ca. 18279-network-handler-behavior.md is now a full copy of 17685. The only edits are to decision 11 (unscoped means every window), its considered options and consequences, and a short Context paragraph saying why. 17685's status line now reads Superseded by [18279].


Generated by Claude Code

@qodo-code-review

Copy link
Copy Markdown
Contributor

Code review by qodo was updated up to the latest commit 75080ca

@titusfortner titusfortner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this copy also changed indentation for sub bullets which breaks formatting.

Drop the context paragraph and the rejected global-only option, make
each rejected default stand on its own, spell out that an unscoped
handler stalls requests in every tab, and rewrap.

Copy link
Copy Markdown
Member Author

@titusfortner On indentation: outside the edited lines, 18279-network-handler-behavior.md is byte-for-byte the same as 17685 on trunk. git diff --no-index between the two files shows only decision 11, its options and its consequences. Which sub-bullets look broken to you? I'll fix them if you can point me at the lines.


Generated by Claude Code

@qodo-code-review

Copy link
Copy Markdown
Contributor

Code review by qodo was updated up to the latest commit f4c4f76

@qodo-code-review

Copy link
Copy Markdown
Contributor

Code review by qodo was updated up to the latest commit e059fce

@titusfortner titusfortner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was IntelliJ that pasted it wrong, sorry for disparaging you, Claude.

@titusfortner

Copy link
Copy Markdown
Member

Oh, we also need to update the reference in https://github.com/SeleniumHQ/selenium/blob/trunk/docs/plans/selenium-5.md

Copy link
Copy Markdown
Member Author

Done in 0dd59ed: docs/plans/selenium-5.md now links to 18279. That was the only other reference to 17685 under docs/.


Generated by Claude Code

@qodo-code-review

Copy link
Copy Markdown
Contributor

Code review by qodo was updated up to the latest commit 0dd59ed

@titusfortner

Copy link
Copy Markdown
Member

For easier review now that we have it in a new ADR, here's the diff: https://gist.github.com/titusfortner/9cc0b89ac5fc63ee9351c92b06cf9261/revisions

@titusfortner titusfortner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, just realized this doesn't account for requests without a window, such as service worker requests, which arrive with a null context and userContext. The default should explicitly cover these too, so it should say the handler applies to every event in the session, not every window.

Copy link
Copy Markdown
Member Author

@titusfortner Good catch, fixed in 68daae3. Decision 11 now says an unscoped handler applies to every event in the session. That includes requests that belong to no window, such as a service worker's, which arrive with no window handle or user context. The consequence on unscoped handlers says the same.


Generated by Claude Code

@selenium-ci

Copy link
Copy Markdown
Member

/agentic_review

@qodo-code-review

Copy link
Copy Markdown
Contributor

Code review by qodo was updated up to the latest commit 68daae3

This branch has not been deployed

No deployments
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.

5 participants