fix(command-surface): allow batch gesture steps without readinessTimeoutMs
Merged
KH
1d ago+64+64+01234567890123456789-3-3-0123456789
Summary
Fixes #5275.
readCommonInput assigned undefined for every common field (including the retired readinessTimeoutMs row), and refuseRetiredInput rejected any own key via Object.hasOwn(record, key). When a batch gesture step was read and then re-read in the gesture daemon writer, that readinessTimeoutMs: undefined key caused INVALID_ARGS.
readCommonInputnow skipsundefinedvalues instead of writingundefinedown keys.refuseRetiredInputnow only refuses whenObject.hasOwn(record, key) && record[key] !== undefined.
Before / after
await client.batch.run({
steps: [{ command: 'gesture', input: { kind: 'fling', direction: 'up', origin: { x: 10, y: 20 }, distance: 400 } }],
});
- Before: Throws
INVALID_ARGS: Batch step 1 gesture input is invalid: readinessTimeoutMs was removed; add an explicit wait for the target before the interaction. - After: Accepted and dispatched. Passing an explicit
readinessTimeoutMs(e.g.5000) is still refused.
Validation
Tested at 6d89210e80:
vitest run --project unit-core packages/command-surface/src/__tests__/input-audience.test.ts packages/client/src/__tests__/index-gesture.test.ts: 2 passed (18 tests)oxlint packages/command-surface packages/client --deny-warnings: 0 warnings, 0 errorsoxfmt --checkon modified files: passedtsc -b tsconfig.typecheck.json: passed
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.