[Bug]: Throttled move and scroll events are dropped, so the cursor travels less than the finger/mouse
Maintainers usually reply within 2 days
@Piyush0000 is already working on this.
Since Nov 23, 2026.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 15/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- typescript
- Domain
- backend
Research direction
Start in src/server/InputHandler.ts at throttle(), where a new message overwrites pendingMove or pendingScroll inside the throttle window. Pointer-lock input in useMouseInput.ts shows the high-rate case. Done means dx/dy are summed into the pending message and a unit test with a mocked injector and fake timers passes. Pull request #453 is already open against this issue, so check it before starting.
Written by the indexing model from the issue text.
Description
Bug Description
InputHandler.throttle() drops cursor movement and scroll distance when events arrive faster than the throttle window (8 ms).
move and scroll messages carry relative deltas (dx, dy). When a message arrives inside the throttle window, it's stored in pendingMove / pendingScroll, and each new message overwrites the previous pending one:
if (now - this[lastKey] < this.throttleMs) {
this[pendingKey] = msg // earlier pending dx/dy are lost
Only the last message in each window is applied, so the cursor travels less than the user's finger or mouse did.
This happens when:
- Network jitter delivers several frame-batched touch moves at once
- Pointer-lock mouse mode (
useMouseInput.ts) sends everymousemovewithout batching, so a high-rate mouse sends far more than one event per 8 ms
I simulated the current logic with 120 moves of 10 px each:
| Arrival pattern | Sent | Applied now | Lost |
|---|---|---|---|
| Steady 60 Hz / 120 Hz | 1200 px | 1200 px | 0% |
| 60 Hz with jitter (bursts of 3) | 1200 px | 800 px | 33% |
| 1 ms apart (high-rate mouse) | 1200 px | 160 px | 87% |
Steps to Reproduce
- Connect a client and use the trackpad on a slow or jittery Wi-Fi link, or use pointer-lock mouse mode with a high polling rate mouse.
- Move the same physical distance quickly vs. slowly.
- The fast movement moves the cursor noticeably less, and scrolling skips.
Expected Behavior
Throttling should limit how often the OS input is injected, without losing distance. Deltas that arrive inside the throttle window should be summed into the pending message, so a 5-event burst of dx: 10 still moves the cursor 50 px.
Desktop Operating System
All (the logic is in the platform-independent src/server/InputHandler.ts)
Client OS and browser
All
Rein Version
main @ 4efa9a8
Proposed fix
Merge dx/dy of the new message into the existing pending message instead of replacing it (about 8 lines in throttle()), and add a unit test with a mocked injector and fake timers. I'd like to work on this.
- Dominant language
- TypeScript
- Stars
- 55
- Forks
- 120
- Avg merge
- 4d 5h
- Merged PRs (30d)
- 24
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from AOSSIE-Org/Rein
-
[Bug]: JSON body null returns 500 on /api/clipboard/copy and /api/clipboard/pastePossibly taken A pull request linked to this issue is open or already merged. Openbug enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
AOSSIE-Org/Rein#522 · 1 comment ·
Maintainers usually reply within 2 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
AOSSIE-Org/Rein#509 · 3 comments ·
Maintainers usually reply within 2 days
-
[Bug]: Session tokens expire 10 days after creation regardless of use (touchToken is never called)Possibly taken @Ankitavasudev claimed this 12 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
AOSSIE-Org/Rein#466 · 6 comments · 1 assignee ·
Maintainers usually reply within 2 days
-
[Bug]: Uploaded files are saved with garbled non-ASCII names and overwrite existing files with the same namePossibly taken @Aryan-en claimed this 23 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
AOSSIE-Org/Rein#458 · 5 comments ·
Maintainers usually reply within 2 days
-
[Bug]: Missing WebRTC playoutDelayHint introduces 50-100ms artificial latency and redundant MediaStream recreation triggers video pipeline reloadPossibly taken @MPoojaSiyag claimed this 1 day ago. Openbug enhancement
Difficulty 3/5 1-2 days Newbie friendliness 35/100
AOSSIE-Org/Rein#523 · 1 comment ·
Maintainers usually reply within 2 days
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 75/100
-
review-followup
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
griffinwork40/agent-afk#5387 ·
Maintainers usually reply within 1 day
-
bug needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
CodeManufactoryLLC/Code60#358 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
android:plan ios:plan main:plan packages:learn
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day