diff --git a/src/lib/server/socket.ts b/src/lib/server/socket.ts index 4cb6ea3..6b90ac5 100644 --- a/src/lib/server/socket.ts +++ b/src/lib/server/socket.ts @@ -11,17 +11,13 @@ export const initSocketIO = (httpServer: HTTPServer): Promise => { if (!io) { console.log('Initializing Socket.IO server...'); io = new Server(httpServer, { - path: '/socket.io/', + path: '/socket.io', cors: { origin: dev ? ['http://localhost:3000'] : ['https://youtubepedia.barron.agency'], methods: ['GET', 'POST'], credentials: true }, - transports: ['websocket', 'polling'], - pingTimeout: 60000, - pingInterval: 25000, - connectTimeout: 45000, - allowEIO3: true + transports: ['websocket', 'polling'] }); io.on('connection', (socket) => { @@ -33,12 +29,8 @@ export const initSocketIO = (httpServer: HTTPServer): Promise => { console.log(`User ${userId} joined their room`); } - socket.on('error', (error) => { - console.error('Socket error:', error); - }); - - socket.on('disconnect', (reason) => { - console.log(`Client disconnected (${reason})`, socket.id); + socket.on('disconnect', () => { + console.log('Client disconnected', socket.id); }); }); diff --git a/src/routes/(main)/dashboard/chat/[id]/+page.server.ts b/src/routes/(main)/dashboard/chat/[id]/+page.server.ts index 3a9eeae..5cddf54 100644 --- a/src/routes/(main)/dashboard/chat/[id]/+page.server.ts +++ b/src/routes/(main)/dashboard/chat/[id]/+page.server.ts @@ -68,9 +68,8 @@ export const actions = { }); const io = getIO(); - const working = io.to(userId).emit('new-question', questionChat); + io.to(userId).emit('new-question', questionChat); - console.log(working); const response = await fetch('/api/ask', { method: 'POST', headers: { diff --git a/src/routes/(main)/dashboard/chat/[id]/+page.svelte b/src/routes/(main)/dashboard/chat/[id]/+page.svelte index 70ef8b3..858eea2 100644 --- a/src/routes/(main)/dashboard/chat/[id]/+page.svelte +++ b/src/routes/(main)/dashboard/chat/[id]/+page.svelte @@ -108,16 +108,10 @@
- - -

Transcript

-
- {data.transcript.content} -
-
-
+

Transcript

+
+ {data.transcript.content} +