debug: Add detailed logging for SSE connection debugging
All checks were successful
build-and-deploy / filter (push) Successful in 2s
build-and-deploy / build (push) Successful in 9s
build-and-deploy / deploy (push) Successful in 10s

- Add timing logs for fetch requests to game server
- Track SSE connection count and lifecycle
- Add client-side logging for received messages
- Log fetch response times and errors
- Monitor connection establishment and closure
This commit is contained in:
2025-07-05 16:55:30 -06:00
parent 5b6b05f840
commit 7de915166f
2 changed files with 24 additions and 5 deletions

View File

@@ -50,6 +50,7 @@ class AdminService {
this.eventSource = new EventSource('/api/sse')
this.eventSource.onopen = () => {
console.log('[AdminService] SSE connection opened')
this.isConnected = true
this.connectionCallback?.(true)
}
@@ -57,14 +58,15 @@ class AdminService {
this.eventSource.onmessage = (event) => {
try {
const data = JSON.parse(event.data)
console.log('[AdminService] SSE message received:', data.type, data.timestamp)
this.callback?.(data)
} catch (error) {
console.error('Error parsing SSE message:', error)
console.error('[AdminService] Error parsing SSE message:', error)
}
}
this.eventSource.onerror = (error) => {
console.error('SSE connection error:', error)
console.error('[AdminService] SSE connection error:', error)
this.isConnected = false
this.connectionCallback?.(false)
}