Compare commits

...

6 Commits

Author SHA1 Message Date
litongjava
203ab6215b feat:remove reconnect error message 2025-01-20 19:29:32 -10:00
litongjava
80231c61fd comment setError(true); when attemptReconnect 2025-01-20 19:26:09 -10:00
litongjava
f2daa4a842 output detail 2025-01-11 20:26:58 -10:00
Tong Li
258b233251 Merge branch 'ItzCrazyKns:master' into master 2025-01-11 20:25:22 -10:00
litongjava
cd1b4de5e8 roll back config 2024-12-08 17:01:35 -10:00
litongjava
4d2b1c6d11 switch to pnpm 2024-12-08 16:48:38 -10:00
7 changed files with 4862 additions and 3463 deletions

View File

@@ -29,10 +29,17 @@ server.listen(port, () => {
startWebSocketServer(server); startWebSocketServer(server);
process.on('uncaughtException', (err, origin) => { process.on('uncaughtException', (error) => {
logger.error(`Uncaught Exception at ${origin}: ${err}`); console.error('Uncaught Exception:', error);
console.error(error.stack);
}); });
process.on('unhandledRejection', (reason, promise) => { process.on('unhandledRejection', (reason, promise) => {
logger.error(`Unhandled Rejection at: ${promise}, reason: ${reason}`); console.error('Unhandled Rejection at:', promise, 'reason:', reason);
if (reason instanceof Error) {
console.error(reason.stack);
} else {
console.error(reason);
}
}); });

View File

@@ -1,2 +1,2 @@
NEXT_PUBLIC_WS_URL=ws://localhost:3001 NEXT_PUBLIC_WS_URL=ws://localhost:3001
NEXT_PUBLIC_API_URL=http://localhost:3001/api NEXT_PUBLIC_API_URL=http://localhost:3001/api

View File

@@ -256,12 +256,14 @@ const useSocket = (
}); });
ws.onerror = () => { ws.onerror = () => {
debugger
clearTimeout(timeoutId); clearTimeout(timeoutId);
setIsWSReady(false); setIsWSReady(false);
toast.error('WebSocket connection error.'); toast.error('WebSocket connection error.');
}; };
ws.onclose = () => { ws.onclose = () => {
debugger
clearTimeout(timeoutId); clearTimeout(timeoutId);
setIsWSReady(false); setIsWSReady(false);
console.debug(new Date(), 'ws:disconnected'); console.debug(new Date(), 'ws:disconnected');
@@ -277,16 +279,19 @@ const useSocket = (
} }
}; };
const attemptReconnect = () => { const attemptReconnect = async () => {
retryCountRef.current += 1; retryCountRef.current += 1;
if (retryCountRef.current > MAX_RETRIES) { if (retryCountRef.current > MAX_RETRIES) {
console.debug(new Date(), 'ws:max_retries'); console.debug(new Date(), 'ws:max_retries');
setError(true); //setError(true);
toast.error(
'Unable to connect to server after multiple attempts. Please refresh the page to try again.', // toast.error(
); // 'Unable to connect to server after multiple attempts. Please refresh the page to try again.',
return; // );
await new Promise((resolve) => setTimeout(resolve, 1000));
//return;
} }
const backoffDelay = getBackoffDelay(retryCountRef.current); const backoffDelay = getBackoffDelay(retryCountRef.current);

View File

@@ -48,8 +48,8 @@ const focusModes = [
icon: ( icon: (
<SiYoutube <SiYoutube
className="h-5 w-auto mr-0.5" className="h-5 w-auto mr-0.5"
onPointerEnterCapture={undefined} onPointerEnter={undefined}
onPointerLeaveCapture={undefined} onPointerLeave={undefined}
/> />
), ),
}, },
@@ -60,8 +60,8 @@ const focusModes = [
icon: ( icon: (
<SiReddit <SiReddit
className="h-5 w-auto mr-0.5" className="h-5 w-auto mr-0.5"
onPointerEnterCapture={undefined} onPointerEnter={undefined}
onPointerLeaveCapture={undefined} onPointerLeave={undefined}
/> />
), ),
}, },

View File

@@ -13,6 +13,7 @@
"dependencies": { "dependencies": {
"@headlessui/react": "^2.2.0", "@headlessui/react": "^2.2.0",
"@icons-pack/react-simple-icons": "^9.4.0", "@icons-pack/react-simple-icons": "^9.4.0",
"@langchain/core": "^0.3.22",
"@langchain/openai": "^0.0.25", "@langchain/openai": "^0.0.25",
"@tailwindcss/typography": "^0.5.12", "@tailwindcss/typography": "^0.5.12",
"clsx": "^2.1.0", "clsx": "^2.1.0",

4835
ui/pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff