Repository navigation
Conversation
|
/agentic_describe |
PR Summary by QodoPreserve fixed key-value tuple types in the BiDi schema
AI Description
Merge Risk
|
Code Review by Qodo
1.
|
…i/selenium into js-bidi-map-entry-tuples
|
/agentic_review |
|
Code review by qodo was updated up to the latest commit ce78f36 |
🔗 Related Issues
BiDi sends a JavaScript
Mapor object as a list of[key, value]pairs. The spec defines each entry as a fixed pair:script.MappingLocalValueandscript.MappingRemoteValueareso every entry has exactly two elements, and only the key may be plain text. The binding-neutral schema loses that, so no generator can enforce it.
💥 What does this PR do?
Where this shows up:
script.callFunctionscript.callFunctionpasses arguments to a function in the page and returns its result:script.CallFunctionParameters.arguments→script.LocalValue→script.MapLocalValue.value→script.MappingLocalValuescript.CallFunctionResult→script.RemoteValue→script.MapRemoteValue.value→script.MappingRemoteValueFor example, calling
(prefs) => prefs.get('theme')with aMapoftheme → "dark"must send:What is lost today
The schema on trunk (
script.MappingLocalValue,script.MappingRemoteValue) projects the entry as:That reads as "a list of any number of elements, each a value or a string". It drops two facts from the spec:
So the schema treats all of these as valid
script.callFunctionarguments, although only the first one is:What each binding does today:
Array<Array<LocalValue | string>>.List<List<Object>>, with only null checks.The changes fix this.
🔧 Implementation Notes
This PR covers only the schema, so the shared format change can be reviewed on its own.
🤖 AI assistance
🔄 Types of changes