fix: increase server update debounce to 2000ms for low bandwidth

Fixes ghost movements when dragging cards on slow connections.
The previous 500ms timeout was too short for network round-trips
on low bandwidth, causing server updates to overwrite local positions
after drag completion.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Thomas Hallock 2025-10-25 07:12:01 -05:00
parent 0dab12f377
commit 633ff12750
1 changed files with 3 additions and 2 deletions

View File

@ -1175,10 +1175,11 @@ export function PlayingPhaseDrag() {
if (!state.cardPositions || state.cardPositions.length === 0) return
if (cardStates.size === 0) return
// Ignore server updates for 500ms after we send our own update
// Ignore server updates for 2000ms after we send our own update
// This prevents replaying our own movements when they bounce back from server
// Increased from 500ms to 2000ms to handle low bandwidth connections
const timeSinceOurUpdate = Date.now() - lastPositionUpdateRef.current
if (timeSinceOurUpdate < 500) return
if (timeSinceOurUpdate < 2000) return
// Check if server positions differ from current positions
let needsUpdate = false