From 48307c643fcd88d5372469bcd4754240f9f06ec0 Mon Sep 17 00:00:00 2001 From: Waleed Latif Date: Wed, 22 Apr 2026 23:00:32 -0700 Subject: [PATCH] chore(realtime): remove unused SOCKET_PORT env var MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit SOCKET_PORT has lived in the socket server since the June 2025 refactor but was never actually set in any deploy config — docker-compose.prod, helm values/templates, .env.example, and docs all use PORT or the 3002 default exclusively. No self-hoster was ever pointed at SOCKET_PORT, so removing it is safe. Simplifies realtime port resolution to `env.PORT` (zod-validated with a 3002 default) and drops the orphaned sim-side schema entry. Co-Authored-By: Claude Opus 4.7 --- apps/realtime/src/env.ts | 1 - apps/realtime/src/index.ts | 2 +- apps/sim/lib/core/config/env.ts | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/apps/realtime/src/env.ts b/apps/realtime/src/env.ts index 91c7e4c648..f08ff5ddd2 100644 --- a/apps/realtime/src/env.ts +++ b/apps/realtime/src/env.ts @@ -10,7 +10,6 @@ const EnvSchema = z.object({ NEXT_PUBLIC_APP_URL: z.string().url(), ALLOWED_ORIGINS: z.string().optional(), PORT: z.coerce.number().int().positive().default(3002), - SOCKET_PORT: z.coerce.number().int().positive().optional(), DISABLE_AUTH: z .string() .optional() diff --git a/apps/realtime/src/index.ts b/apps/realtime/src/index.ts index 6ea031163b..dde8e67e44 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.SOCKET_PORT ?? env.PORT ?? 3002) + const PORT = env.PORT logger.info('Starting Socket.IO server...', { port: PORT, diff --git a/apps/sim/lib/core/config/env.ts b/apps/sim/lib/core/config/env.ts index ea14dcad18..0acd2c4e9e 100644 --- a/apps/sim/lib/core/config/env.ts +++ b/apps/sim/lib/core/config/env.ts @@ -248,7 +248,6 @@ export const env = createEnv({ // Real-time Communication SOCKET_SERVER_URL: z.string().url().optional(), // WebSocket server URL for real-time features - SOCKET_PORT: z.number().optional(), // Port for WebSocket server PORT: z.number().optional(), // Main application port INTERNAL_API_BASE_URL: z.string().optional(), // Optional internal base URL for server-side self-calls; must include protocol if set (e.g., http://sim-app.namespace.svc.cluster.local:3000) ALLOWED_ORIGINS: z.string().optional(), // CORS allowed origins