[adr] network handler behavior proposal#17685
Conversation
PR Summary by QodoADR: Define network handler disposition, ordering, and failure semantics Description
Diagram
High-Level Assessment
Files changed (1)
|
Code Review by Qodo
Context used✅ Compliance rules (platform):
11 rules 1. Java order nondeterministic
|
b09a2bc to
18895d1
Compare
|
Code review by qodo was updated up to the latest commit 18895d1 |
diemol
left a comment
There was a problem hiding this comment.
I think this ADR will help us unify handler behavior across all language bindings, which is currently handled differently in each language.
If I understand this correctly, @titusfortner suggests this ADR is an alternative to #17671. But what I see is that this ADR covers network interception, which blocks because it waits for a handler disposition. Whereas #17671 is about observation, which should not block, and only subscribes to events (did I get that right, @AutomatedTester?).
That is why I believe the two ADRs complement each other.
In addition, this ADR, like #17671, seems to me to be a middle-layer API. One that users would use for specific use cases that the high-level API won't cover.
In the last TLC meeting people were pushing for the idea that for now everything that can block will block in our implementations and we won't handle it any differently. I'm saying they are in opposition because if you adopt this ADR, you don't need the extra methods proposed by the other ADR. Also, I think it is wrong to characterize these as "middle-layer API." Anything that affects the code the user needs to write is user-facing and needs to be part of the high-level API contract we are creating that we want to maintain. |
The way I see these two ADRs:
That's why I think there are two other options: either observe or intercept here. I still think that this is a middle-layer API. I don't want the user to have to handle all these callbacks and other things to manipulate their code in BiDi. I want this API to land and be used in a higher-level API to do network routing, mocking, and method interception, covering all of this implementation. In my head, we should have:
If this current ADR is what we're doing at the high level, it is way too complex. |
|
Code review by qodo was updated up to the latest commit 281e9bb |
|
Code review by qodo was updated up to the latest commit 895d532 |
Can we get the functionality implemented across the bindings then figure out which wrappers and helpers and fixtures to add later? I feel like we may need to step back from the ADRs and agree to the milestones and requirements for Selenium 5 again. |
This is confusing because my interpretation is that the
I think this bit is what #17671 and this ADR need to agree on. That is the foundation for both.
I am calling it a middle layer, which is core to what we want to achieve, because when I check Playwright's API, I see a high-level API that lets users handle less. But I think you have a point: landing all this "first and later" about major abstractions. |
Based on your questions it didn't seem like you understood my intention for including it or how it worked (it was never blocking anything, there was nothing in the lambda that needed resolving or a true state), so it seemed distracting from what I consider to be the primary things I want us to agree on. Essentially 17671 and the "complete" method are 2 different ways to manage a wrapper around behavior the user can already easily do themselves for network calls. Is it actually a priority to provide convenience methods to replaces those 4 lines? When I started thinking in those terms I decided that we don't need wrapper behavior right now, so if I want to reject 17671 on that basis, I should also reject my "complete" method. If we decide we want wrapper behavior, then I would still prefer "complete" over "expect_*" But also it feels like we're arguing over implementation details of a concept we haven't even agreed is behavior we need right now, so I also want to be able to step back one level on it. For instance, I don't think "how to differentiate between observation and interception" is actually fundamental to any of our other conversations. The TLC meeting 2 weeks ago the general consensus from everyone else was to defer this decision until later because "intercept everything for now" works well enough for most things. I'd rather hammer it out now, but I'm fine with pushing it off. I only added it here to show that supporting it isn't a sufficient reason on its own to expand the API and accept 17671. |
📄 The decision, its rationale, considered options, and consequences are in the record file
this PR adds (
docs/decisions/17685-network-handler-behavior.md);read it there. The sections below are proposal notes and review logistics.
🔗 Related
📝 Proposal notes
on/route, and [docs] decision: BiDi events are awaited with expect_* context managers #17671 — observation and interception are treated as mutually exclusive, requiring separate APIs; a separate record would concede that framing, which is what's contested. Body collection is here because it's part of the same handler registration, not a separable concern.complete/capture primitive for saving an event for later assertion (considered but deferred — not worth adding right now).🗣 Discussion
For reviewers and the TLC (input wanted, not a defect):
📌 Tracking
Tracking issue: (linked on acceptance)