LINUS ROUND 2: Tests for automation + CRM handlers, fix vet errors
- automation/engine_test.go: 8 tests (cron parser, actions, start/stop) - handlers/crm_test.go: 6 tests (CRUD + not-found) - backend/main_test.go: config validation test - Fixed websocket unreachable code - Deleted events/kafka.go placeholder
This commit is contained in:
@@ -99,33 +99,6 @@ func (h *Hub) HandleWebSocket(w http.ResponseWriter, r *http.Request) {
|
||||
h.logger.Warn().Msg("websocket connection rejected: JWT validation not implemented")
|
||||
w.WriteHeader(http.StatusUnauthorized)
|
||||
return
|
||||
|
||||
conn, err := upgrader.Upgrade(w, r, nil)
|
||||
if err != nil {
|
||||
h.logger.Error().Err(err).Msg("websocket upgrade failed")
|
||||
return
|
||||
}
|
||||
|
||||
tenantID := r.URL.Query().Get("tenant_id")
|
||||
userID := r.URL.Query().Get("user_id")
|
||||
|
||||
if tenantID == "" {
|
||||
tenantID = "default"
|
||||
}
|
||||
|
||||
client := &Client{
|
||||
hub: h,
|
||||
conn: conn,
|
||||
send: make(chan []byte, 256),
|
||||
tenantID: tenantID,
|
||||
userID: userID,
|
||||
}
|
||||
|
||||
client.hub.register <- client
|
||||
|
||||
// Start goroutines for reading and writing
|
||||
go client.writePump()
|
||||
go client.readPump()
|
||||
}
|
||||
|
||||
// Broadcast sends a message to all connected clients
|
||||
|
||||
Reference in New Issue
Block a user