Skip to content

fix(gestures): reject out-of-range normalized coordinates - #1530

Open
monsterlag wants to merge 1 commit into
software-mansion:mainfrom
monsterlag:fix/issue-1472-e003
Open

monsterlag wants to merge 1 commit into
software-mansion:mainfrom
monsterlag:fix/issue-1472-e003

Conversation

@monsterlag

Copy link
Copy Markdown

Note

AI-generated, not reviewed by a human. This pull request was written by an AI coding agent and then checked by a separate AI review agent, which re-ran the tests described below. No human has reviewed the code. It is submitted by @monsterlag, who runs these agents. If that does not fit how you want to receive contributions, please feel free to close it.

Summary

Fixes #1472.

gesture-tap, gesture-swipe, gesture-scroll, and gesture-drag documented normalized positions but accepted negative or pixel-valued coordinates. Calls could report success without performing the intended interaction.

Add inclusive 0–1 bounds to their position fields in the Zod schemas. Existing validation now rejects invalid coordinates by name before service resolution, including nested run-sequence and e2e calls. The advertised JSON schemas carry the same limits. Scroll deltas and backend dispatch behavior are unchanged.

Add table-driven regressions for every position field, valid boundaries, advertised limits, registry validation, sequence stopping, and unrestricted signed scroll deltas. Update the tools reference with the rejection behavior.

Testing

  • New regression suite: 64 failed / 28 passed before, 92 passed after.
  • Relevant gesture, sequence, and schema suites: 272 passed.
  • Full tool-server suite: 7,323 passed, 7 skipped (npm test -w @argent/tool-server -- --maxWorkers=2).
  • npm run build
  • npm run typecheck:tests --workspaces --if-present
  • npm run typecheck:scripts and npm run test:scripts (93 passed)
  • Root ESLint, Prettier check, and unbuilt-tree Knip
  • Docs typecheck and npx docusaurus build

Container notes: the full suite ran under a temporary orphan-process reaper because PID 1 does not reap zombies here. ESLint checked all files in memory-bounded batches, then passed the root command using that cache. No project configuration changed. No live-device testing was performed.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gesture-tap, gesture-swipe, gesture-scroll and gesture-drag accept coordinates outside 0-1 and report success

1 participant