Skip to content

perf(queue): optimize syncAllSlots to batch sends and deduplicate DB queries#519

Open
garrappachc wants to merge 1 commit intomasterfrom
feat/optimize-sync-all-slots
Open

perf(queue): optimize syncAllSlots to batch sends and deduplicate DB queries#519
garrappachc wants to merge 1 commit intomasterfrom
feat/optimize-sync-all-slots

Conversation

@garrappachc
Copy link
Member

Summary

  • Batch all queue slot renders into a single gateway.send call instead of one call per slot, reducing gateway iterations from N to 1
  • Fetch actor player data once per send invocation and pass it as actorPlayer prop to QueueSlot, eliminating redundant DB queries (was querying once per slot per connected player)
  • Add actorPlayer optional prop to QueueSlot component with 'actorPlayer' in props guard to skip the DB lookup when data is pre-fetched

Test plan

  • pnpm test passes (new sync-clients.test.ts verifies gateway.send called once for all slots)
  • pnpm lint passes

🤖 Generated with Claude Code

…queries

Batch all queue slot renders into a single gateway.send call instead of
one per slot, and fetch actor player data once per send invocation passing
it as actorPlayer prop to QueueSlot to avoid redundant DB queries.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Contributor

github-actions bot commented Mar 9, 2026

Playwright test results

passed  196 passed
flaky  1 flaky

Details

stats  197 tests across 29 suites
duration  8 minutes, 6 seconds
commit  e60b131

Flaky tests

chromium › 10-queue/09-tracks-online-players.spec.ts › tracks online players @6v6 @9v9

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant