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:
Bernt (LandveX AI)
2026-07-14 12:41:44 +00:00
parent c2b10347b1
commit a31f79c22a
8 changed files with 465 additions and 332 deletions
-27
View File
@@ -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