Skip to content

fix(input): prevent recursive throttling loop in InputHandler#346

Open
Akash504-ai wants to merge 1 commit into
AOSSIE-Org:mainfrom
Akash504-ai:fix/inputhandler-throttling
Open

fix(input): prevent recursive throttling loop in InputHandler#346
Akash504-ai wants to merge 1 commit into
AOSSIE-Org:mainfrom
Akash504-ai:fix/inputhandler-throttling

Conversation

@Akash504-ai
Copy link
Copy Markdown

Addressed Issues:

Fixes # (InputHandler throttling recursion issue)

Description

This PR fixes a recursion issue in the InputHandler throttling logic.

Previously, throttled "move" and "scroll" events were reprocessed using the same handleMessage method without distinguishing internal calls. This caused repeated re-throttling, leading to potential recursive loops, delayed execution, and degraded responsiveness under high-frequency input.

Fix implemented:

  • Introduced an internal flag in handleMessage
  • Throttling is now applied only to external messages
  • Deferred (throttled) messages bypass throttling when executed

Impact:

  • Prevents recursive throttling loops
  • Improves responsiveness and stability of input handling
  • Ensures predictable behavior under rapid input events

Screenshots/Recordings:

N/A (internal logic fix)

Functional Verification

  • Please check off the behaviors verified with this change.

Screen Mirror

  • Screen MIrror works.

Authentication

  • Connection doesn't work without a valid token.

Basic Gestures

  • One-finger tap: Verified as Left Click.
  • Two-finger tap: Verified as Right Click.
  • Click and drag: Verified selection behavior.
  • Pinch to zoom: Verified zoom functionality (if applicable).

Modes & Settings

  • Cursor mode: Cursor moves smoothly and accurately.
  • Scroll mode: Page scrolls as expected.
  • Sensitivity: Verified changes in cursor speed/sensitivity settings.
  • Copy and Paste: Verified both Copy and Paste functionality.
  • Invert Scrolling: Verified scroll direction toggles correctly.

Advanced Input

  • Key combinations: Verified "hold" behavior for modifiers (e.g., Ctrl+C) and held keys are shown in buffer.
  • Keyboard input: Verified Space, Backspace, and Enter keys work correctly.
  • Glide typing: Verified path drawing and text output.
  • Voice input: Verified speech-to-text functionality for full sentences.
  • Backspace doesn't send the previous input.

Any other gesture or input behavior introduced:

  • New Gestures: Verified any other gesture or input behavior introduced in this PR.

Additional Notes:

Changes are limited to InputHandler logic
No API or external behavior changes
Backward compatible with existing system

Checklist

  • My PR addresses a single issue, fixes a single bug or makes a single improvement.
  • My code follows the project's code style and conventions
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • If applicable, I have made corresponding changes or additions to the documentation
  • If applicable, I have made corresponding changes or additions to tests
  • My changes generate no new warnings or errors
  • I have joined the community and I will share a link to this PR with the project maintainers there
  • I have read the contributing guidelines
  • Once I submit my PR, CodeRabbit AI will automatically review it and I will address CodeRabbit's comments.
  • Incase of UI change I've added a demo video.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 2, 2026

Warning

Rate limit exceeded

@Akash504-ai has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 38 minutes and 43 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 715d7c45-945a-4dbe-acb2-6577c0595c6e

📥 Commits

Reviewing files that changed from the base of the PR and between 782183e and f50eba6.

📒 Files selected for processing (1)
  • src/server/InputHandler.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 38 minutes and 43 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

1 participant