From 85d6e3d57999b70ffab44aee2dfc9aa2c34c6fb2 Mon Sep 17 00:00:00 2001 From: Ahmad Nakhala Date: Mon, 31 Aug 2026 13:01:14 -0400 Subject: [PATCH 1/3] fix(engine): target stockfish server url exclusively for stockfish analysis endpoint --- .../src/features/engine/StockfishTutor.tsx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/react-ystemandchess/src/features/engine/StockfishTutor.tsx b/react-ystemandchess/src/features/engine/StockfishTutor.tsx index eea1668e..a2f76618 100644 --- a/react-ystemandchess/src/features/engine/StockfishTutor.tsx +++ b/react-ystemandchess/src/features/engine/StockfishTutor.tsx @@ -1071,11 +1071,9 @@ const StockfishTutor: React.FC = ({ enabled, trigger, fenBefore, fenAfter // eslint-disable-next-line no-console console.debug('StockfishTutor: analyzing move', { fenBefore, fenAfter, moveUci, uciHistory }); try { setDebugLog(`analyzing move ${moveUci} | fenBefore=${fenBefore.split(' ')[0]}...`); } catch (e) { /* ignore */ } - // Safely read environment URL keys - const urls = (environment && (environment as any).urls) || {}; - // Support multiple environment keys: prefer unified chessServerURL but - // also accept stockfishServerURL (some deployments use that name). - const rawBase = urls.chessServerURL || urls.stockfishServerURL || urls.chessServer || urls.stockfishServer || ''; + // Stockfish analysis endpoint (/api/analyze) is hosted on stockfishServerURL. + // chessServerURL is websocket-only and does not handle HTTP analysis. + const rawBase = urls.stockfishServerURL || urls.stockfishServer || ''; const baseUrl = typeof rawBase === 'string' ? rawBase.replace(/\/$/, '') : ''; if (!baseUrl) { From d9092e30a7ef6fd1dbad88f8253566a216b6fd77 Mon Sep 17 00:00:00 2001 From: Ahmad Nakhala Date: Mon, 31 Aug 2026 13:05:55 -0400 Subject: [PATCH 2/3] fix(tutor): restore environment urls reference in StockfishTutor --- react-ystemandchess/src/features/engine/StockfishTutor.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/react-ystemandchess/src/features/engine/StockfishTutor.tsx b/react-ystemandchess/src/features/engine/StockfishTutor.tsx index a2f76618..c5643794 100644 --- a/react-ystemandchess/src/features/engine/StockfishTutor.tsx +++ b/react-ystemandchess/src/features/engine/StockfishTutor.tsx @@ -1073,6 +1073,7 @@ const StockfishTutor: React.FC = ({ enabled, trigger, fenBefore, fenAfter try { setDebugLog(`analyzing move ${moveUci} | fenBefore=${fenBefore.split(' ')[0]}...`); } catch (e) { /* ignore */ } // Stockfish analysis endpoint (/api/analyze) is hosted on stockfishServerURL. // chessServerURL is websocket-only and does not handle HTTP analysis. + const urls = (environment && (environment as any).urls) || {}; const rawBase = urls.stockfishServerURL || urls.stockfishServer || ''; const baseUrl = typeof rawBase === 'string' ? rawBase.replace(/\/$/, '') : ''; From 13afac295888bc7bfeeda132cc8eb31f573ce00b Mon Sep 17 00:00:00 2001 From: sweksha-cloud Date: Fri, 9 Oct 2026 05:13:39 -0700 Subject: [PATCH 3/3] fix(frontend): point dev chessServerURL at chessServer on 3001 --- react-ystemandchess/src/environments/environment.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/react-ystemandchess/src/environments/environment.js b/react-ystemandchess/src/environments/environment.js index bbdeb1fc..abdffcf2 100644 --- a/react-ystemandchess/src/environments/environment.js +++ b/react-ystemandchess/src/environments/environment.js @@ -6,7 +6,7 @@ export const environment = { urls: { middlewareURL: 'http://localhost:8000', stockfishServerURL: 'http://localhost:8080', // unified naming - chessServerURL: 'http://localhost:8080', // point to mock stockfish server for testing + chessServerURL: 'http://localhost:3001', // chessServer (socket.io game state) }, productionType: 'development', // development/production }; \ No newline at end of file