chore(logging): remove excessive console.log and console.info statements in frontend
MindSift CI & Docker Release / Build, Test in Container & Push (push) Successful in 59s

This commit is contained in:
sandrodach committed 2026-10-27 20:57:05 +01:00
1 parent 63a5885155
commit 6129681035
1 file changed
-12
-12
View File
@@ -1135,7 +1135,6 @@ const globalSubscribedRooms = new Set<string>();
function notifyRealtimeStatusChange(connected: boolean, transport: RealtimeTransport) { function notifyRealtimeStatusChange(connected: boolean, transport: RealtimeTransport) {
isRealtimeConnectedState = connected; isRealtimeConnectedState = connected;
activeTransport = transport; activeTransport = transport;
console.log(`[MindSift Realtime] Verbindungsstatus geändert: connected=${connected}, transport=${transport}`);
realtimeStatusListeners.forEach((fn) => { realtimeStatusListeners.forEach((fn) => {
try { try {
fn(connected, transport); fn(connected, transport);
@@ -1180,17 +1179,14 @@ export function connectSSE(rooms?: string[]): void {
try { try {
const url = buildSSEURL(undefined, undefined, Array.from(globalSubscribedRooms)); const url = buildSSEURL(undefined, undefined, Array.from(globalSubscribedRooms));
console.log(`[MindSift Realtime] Verbinde SSE zu ${url}...`);
const es = new EventSource(url); const es = new EventSource(url);
activeGlobalSSE = es; activeGlobalSSE = es;
es.onopen = () => { es.onopen = () => {
console.info('[MindSift Realtime] Server-Sent Events (SSE) erfolgreich verbunden (Corporate Fallback aktiv).');
sseReconnectDelay = 2000; sseReconnectDelay = 2000;
notifyRealtimeStatusChange(true, 'sse'); notifyRealtimeStatusChange(true, 'sse');
if (activeSSEId && globalSubscribedRooms.size > 0) { if (activeSSEId && globalSubscribedRooms.size > 0) {
globalSubscribedRooms.forEach((room) => { globalSubscribedRooms.forEach((room) => {
console.log(`[MindSift Realtime] SSE Rejoin Room "${room}"`);
api.joinSSERoom(activeSSEId!, room, 'join').catch(() => {}); api.joinSSERoom(activeSSEId!, room, 'join').catch(() => {});
}); });
} }
@@ -1199,13 +1195,10 @@ export function connectSSE(rooms?: string[]): void {
es.onmessage = (event) => { es.onmessage = (event) => {
try { try {
const msg = JSON.parse(event.data) as WSMessage; const msg = JSON.parse(event.data) as WSMessage;
console.log('[MindSift Realtime Event] [SSE]', msg.event, msg.payload);
if (msg.event === 'SSE_CONNECTED') { if (msg.event === 'SSE_CONNECTED') {
activeSSEId = msg.payload?.sseId || null; activeSSEId = msg.payload?.sseId || null;
console.log('[MindSift Realtime] SSE-Client registriert mit ID:', activeSSEId);
if (activeSSEId && globalSubscribedRooms.size > 0) { if (activeSSEId && globalSubscribedRooms.size > 0) {
globalSubscribedRooms.forEach((room) => { globalSubscribedRooms.forEach((room) => {
console.log(`[MindSift Realtime] Trete Raum per SSE bei: "${room}"`);
api.joinSSERoom(activeSSEId!, room, 'join').catch(() => {}); api.joinSSERoom(activeSSEId!, room, 'join').catch(() => {});
}); });
} }
@@ -1254,7 +1247,6 @@ export function connectWebSocket(): void {
// If proxy blocked WebSocket previously, do not attempt failing WebSocket; stay on SSE // If proxy blocked WebSocket previously, do not attempt failing WebSocket; stay on SSE
if (isWsBlockedByProxy) { if (isWsBlockedByProxy) {
console.info('[MindSift Realtime] WebSocket im Firmennetzwerk blockiert (Cache aktiv). Verwende direkt SSE.');
connectSSE(); connectSSE();
return; return;
} }
@@ -1269,7 +1261,6 @@ export function connectWebSocket(): void {
try { try {
const url = buildWebSocketURL(); const url = buildWebSocketURL();
console.log(`[MindSift Realtime] Versuche WebSocket-Verbindung zu ${url}...`);
const ws = new WebSocket(url); const ws = new WebSocket(url);
activeGlobalWS = ws; activeGlobalWS = ws;
@@ -1282,7 +1273,6 @@ export function connectWebSocket(): void {
ws.onopen = () => { ws.onopen = () => {
clearTimeout(wsConnectionWatchdog); clearTimeout(wsConnectionWatchdog);
console.info('[MindSift Realtime] WebSocket erfolgreich verbunden!');
if (activeGlobalSSE) { if (activeGlobalSSE) {
try { activeGlobalSSE.close(); } catch {} try { activeGlobalSSE.close(); } catch {}
activeGlobalSSE = null; activeGlobalSSE = null;
@@ -1292,7 +1282,6 @@ export function connectWebSocket(): void {
if (globalSubscribedRooms.size > 0) { if (globalSubscribedRooms.size > 0) {
globalSubscribedRooms.forEach((room) => { globalSubscribedRooms.forEach((room) => {
try { try {
console.log(`[MindSift Realtime] Trete Raum per WS bei: "${room}"`);
ws.send(JSON.stringify({ event: 'JOIN_ROOM', room })); ws.send(JSON.stringify({ event: 'JOIN_ROOM', room }));
} catch {} } catch {}
}); });
@@ -1302,7 +1291,6 @@ export function connectWebSocket(): void {
ws.onmessage = (event) => { ws.onmessage = (event) => {
try { try {
const msg = JSON.parse(event.data) as WSMessage; const msg = JSON.parse(event.data) as WSMessage;
console.log('[MindSift Realtime Event] [WS]', msg.event, msg.payload);
wsListeners.forEach((fn) => { wsListeners.forEach((fn) => {
try { try {
fn(msg); fn(msg);