Skip to content

Commit 9603d5f

Browse files
docs(webdriver): clarify focus probe boundaries and release note
1 parent 42da949 commit 9603d5f

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

‎.changeset/focused-identity-probe.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
'agent-device': patch
33
---
44

5-
Read only the focused element identity before WebDriver fill taps its target. Avoid an unnecessary previous-field rectangle request that can exhaust the focus-probe budget; retain the post-tap identity/geometry checks and existing deadlines.
5+
Fix WebDriver fill failing before tapping the target because it unnecessarily reads the previously focused field's geometry.

‎packages/provider-webdriver/src/webdriver-client.test.ts‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,9 +219,7 @@ test('createSession is bounded by the operation deadline when it is shorter', as
219219
);
220220
});
221221

222-
// The focused element is the only signal that can say WHICH field took focus,
223-
// so `fill` fails closed when it is unavailable. Each wire shape it
224-
// distinguishes is pinned here.
222+
// The pre-tap lookup consumes identity only; geometry must not be requested here.
225223
test('activeElementReference reads only the focused identity, not its geometry', async () => {
226224
const paths: string[] = [];
227225
const client = await connectedClient(async (input) => {
@@ -233,6 +231,9 @@ test('activeElementReference reads only the focused identity, not its geometry',
233231
assert.deepEqual(paths, ['/wd/hub/session/wd-1/element/active']);
234232
});
235233

234+
// The focused element is the only signal that can say WHICH field took focus,
235+
// so `fill` fails closed when it is unavailable. Each wire shape it
236+
// distinguishes is pinned here.
236237
test('activeElement returns the focused element id and rect', async () => {
237238
const client = await connectedClient(
238239
webDriverRoutes({

‎packages/provider-webdriver/src/webdriver-client.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ export class WebDriverClient {
236236
// overrun the deadline it was derived from. One deadline, and the second
237237
// request gets only what the first left.
238238
const deadline = timeoutMs === undefined ? undefined : Date.now() + timeoutMs;
239+
// The ID lookup receives only the outer operation's remaining budget.
239240
const reference = await this.activeElementReference(requestBudget(deadline).timeoutMs);
240241
if (typeof reference === 'string') return reference;
241242
const elementId = reference.id;

0 commit comments

Comments
 (0)