[docs] decision: storage exposes a typed cookie API and storage_state save/restore#17673
[docs] decision: storage exposes a typed cookie API and storage_state save/restore#17673AutomatedTester wants to merge 3 commits into
Conversation
be86795 to
5a87b78
Compare
… partition unit Rename 0003 -> 17673 and note that the raw-partition escape hatch covers targeting a specific user context (17681).
diemol
left a comment
There was a problem hiding this comment.
I know we have in some bindings the storage namespace for BiDi. So, unless I am wrong, we are assuming a new top-level namespace in this ADR (driver.storage), but driver.manage().addCookie() already exists and does the same job from the user point of view.
Unless this ADR refers to a middle-layer API, we should agree on which strategy:
Option A: Explicit BiDi API. driver.storage is for BiDi sessions. Classic APIs stay for Classic sessions. Users opt in knowingly. Eventually, we need to migrate users from one to the other.
Option B: Transparent abstraction. The high-level API stays unified, and the binding picks Classic or BiDi under the hood. Then, driver.storage should be an internal or middle-layer API.
This pattern repeats across every module in this series (navigation, network, emulation, etc.), so the answer affects all of them.
Note in Context that the typed storage API is a Layer 2 module beside the Classic cookie API, per the layering decision 17709.
|
You've put your finger on the cross-cutting question exactly, and I think it deserved a decision of its own rather than being answered ad-hoc in each module ADR — so I've written up #17709 ("BiDi is exposed in three API layers") to settle it for the whole series. Short version: it's both A and B, layered.
I've added a line to this ADR's Context declaring it a Layer 2 decision. Could you take a look at #17709? If we agree on the layering there, this one (and navigation/network/emulation) stop competing with the Classic surface — which I think is what made them feel like duplicate namespaces. |
💥 What does this PR do?
Proposes a design decision record: storage exposes a typed cookie API and
storage_statesave/restore.BiDi cookies use an awkward wire shape (
valueis aBytesValuedescriptor, partitioning via a descriptor), so the common "set a session cookie" case carries needless ceremony. And the most-requested workflow — log in once, capture state, restore it to skip login in later sessions (Playwright'sstorage_state) — has no Selenium equivalent. This record proposes a typedCookievalue forset_cookie/get_cookiesplus asave_state/load_statepair, while being explicit that cookies come from the BiDi protocol whereaslocalStorageis captured viascript.evaluateand IndexedDB is out of scope.🔧 Implementation Notes
docs/decisions/process from [docs] add design decision record process and template #17665 — depends on [docs] add design decision record process and template #17665 landing (adds onlydocs/decisions/0003-*.md).storage_statecaptureslocalStorageby evaluating script per origin — the record documents this split deliberately rather than implying uniform protocol support.🤖 AI assistance
💡 Additional Considerations
One of a set of BiDi ergonomics decision records proposed together. The cookie convenience and
storage_stateare kept in one record as a single cohesive storage-ergonomics decision; reviewers who prefer them split can request that. Cross-binding convergence is tracked in the binding-status table.🔄 Types of changes