From 86dbab6aa6ee5f0ae3c8d08c4859eb6ddbb78d42 Mon Sep 17 00:00:00 2001 From: Waleed Latif Date: Wed, 22 Apr 2026 22:55:32 -0700 Subject: [PATCH] chore(realtime): address PR review feedback - Remove redundant SOCKET_PORT=3002 env from Dockerfile runner stage (env.PORT already defaults to 3002 via zod schema). - Reorder PORT fallback so an explicitly-set SOCKET_PORT wins over the schema default for PORT; keeps SOCKET_PORT functional as an override instead of dead code. - Add dedicated type-check CI step for @sim/realtime so TS errors surface pre-deploy (the Dockerfile runs source TS via Bun and has no implicit build-time type check). Co-Authored-By: Claude Opus 4.7 --- .github/workflows/test-build.yml | 3 +++ apps/realtime/src/index.ts | 2 +- docker/realtime.Dockerfile | 1 - 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml index 1dea765308..8bcd240011 100644 --- a/.github/workflows/test-build.yml +++ b/.github/workflows/test-build.yml @@ -109,6 +109,9 @@ jobs: - name: Verify realtime prune graph run: bun run check:realtime-prune + - name: Type-check realtime server + run: bunx turbo run type-check --filter=@sim/realtime + - name: Run tests with coverage env: NODE_OPTIONS: '--no-warnings --max-old-space-size=8192' diff --git a/apps/realtime/src/index.ts b/apps/realtime/src/index.ts index aae6dfed3f..6ea031163b 100644 --- a/apps/realtime/src/index.ts +++ b/apps/realtime/src/index.ts @@ -29,7 +29,7 @@ async function createRoomManager(io: SocketIOServer): Promise { async function main() { const httpServer = createServer() - const PORT = Number(env.PORT || env.SOCKET_PORT || 3002) + const PORT = Number(env.SOCKET_PORT ?? env.PORT ?? 3002) logger.info('Starting Socket.IO server...', { port: PORT, diff --git a/docker/realtime.Dockerfile b/docker/realtime.Dockerfile index 36891f49b6..8092709267 100644 --- a/docker/realtime.Dockerfile +++ b/docker/realtime.Dockerfile @@ -37,7 +37,6 @@ WORKDIR /app ENV NODE_ENV=production \ PORT=3002 \ - SOCKET_PORT=3002 \ HOSTNAME="0.0.0.0" RUN addgroup -g 1001 -S nodejs && \