Skip to content

Fix WebSocket URL using wrong config field (baseUrl instead of websocketUrl)#4

Merged
OmeWillem merged 1 commit into
mainfrom
copilot/fix-websocket-functionality
Mar 31, 2026
Merged

Fix WebSocket URL using wrong config field (baseUrl instead of websocketUrl)#4
OmeWillem merged 1 commit into
mainfrom
copilot/fix-websocket-functionality

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 31, 2026

PR #2 moved WS URL construction server-side but accidentally used atlasConfig.baseUrl (the web app's own origin) instead of atlasConfig.websocketUrl (the Atlas API URL with ws:///wss:// protocol). This broke all WebSocket functionality. PR #3 kept the same root cause.

Change

  • getWebSocketToken handler — swap baseUrl.replace(/^http/, "ws") for websocketUrl, which is already stored at setup time as atlasUrl with the correct WebSocket protocol:
// Before (broken — points at the web app, not the Atlas API)
wsUrl: `${configManager.getAtlasConfig()?.baseUrl!.replace(/^http/, "ws")}/api/v1/servers/${serverId}/ws`

// After — matches what the original client-side code used before PR #2
wsUrl: `${configManager.getAtlasConfig()?.websocketUrl}/api/v1/servers/${serverId}/ws`

websocketUrl is set during setup as atlasUrl.replace("https://", "wss://").replace("http://", "ws://"), making it the correct base for Atlas API WebSocket connections.

@OmeWillem OmeWillem marked this pull request as ready for review March 31, 2026 00:32
@OmeWillem OmeWillem merged commit 592cbc0 into main Mar 31, 2026
1 check passed
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.

2 participants