Skip to content

Fix reconnection race in golf websocket server#1154

Merged
aaylward merged 1 commit intomainfrom
fix-reconnect-race
Apr 12, 2026
Merged

Fix reconnection race in golf websocket server#1154
aaylward merged 1 commit intomainfrom
fix-reconnect-race

Conversation

@aaylward
Copy link
Copy Markdown
Collaborator

Restructure reconnectPlayer to return restore data instead of spawning a goroutine with a 10ms sleep. handleAuthenticate now sends authenticated, roomJoined, and gameJoined synchronously after releasing the lock, eliminating the window where a client could act before receiving its restored state.

Closes #1152

Restructure reconnectPlayer to return restore data instead of spawning
a goroutine with a 10ms sleep. handleAuthenticate now sends authenticated,
roomJoined, and gameJoined messages synchronously after releasing the
lock, eliminating the window where a client could act before receiving
its restored state.

Fixes #1152
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
1d4-web 4d27ca8 Commit Preview URL

Branch Preview URL
Apr 12 2026, 06:33 PM

@aaylward aaylward enabled auto-merge (squash) April 12, 2026 18:34
@aaylward aaylward merged commit 01dba3d into main Apr 12, 2026
12 checks passed
@aaylward aaylward deleted the fix-reconnect-race branch April 12, 2026 18:38
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.

Golf: reconnection state sent from unlocked goroutine causes race

1 participant