Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fix-welcome-useeffect-spam.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@couch-kit/host": patch
---

Fix: move WELCOME useEffect debug log after early-return guard to prevent console spam on every state change
6 changes: 6 additions & 0 deletions packages/host/src/provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,12 @@ export function GameHostProvider<S extends IGameState, A extends IAction>({
if (pendingWelcome.current.size === 0) return;
if (!wsServer.current) return;

if (configRef.current.debug) {
console.log(
`[GameHost] Sending WELCOME/RECONNECTED to ${pendingWelcome.current.size} client(s)`,
);
}

const server = wsServer.current;
for (const [
socketId,
Expand Down