diff --git a/docs/development/CENTRAL.md b/docs/development/CENTRAL.md index 8d2b157..605769d 100644 --- a/docs/development/CENTRAL.md +++ b/docs/development/CENTRAL.md @@ -77,3 +77,4 @@ - [Responsive Pack Grid Layout](./devlog/2025-12-17-142500_responsive_pack_grid.md): Completed. Implemented responsive multi-column grid for generated packs when card size is reduced (<25% slider). - [Stack View Consistency Fix](./devlog/2025-12-17-143000_stack_view_consistency.md): Completed. Removed transparent overrides for Stack View, ensuring it renders with the standard unified container graphic. - [Dynamic Pack Grid Layout](./devlog/2025-12-17-144000_dynamic_pack_grid.md): Completed. Implemented responsive CSS grid with `minmax(550px, 1fr)` for Stack/Grid views to auto-fit packs based on screen width without explicit column limits. +- [Fix Socket Payload Limit](./devlog/2025-12-17-152700_fix_socket_payload_limit.md): Completed. Increased Socket.IO `maxHttpBufferSize` to 300MB to support massive drafting payloads. diff --git a/docs/development/devlog/2025-12-17-152700_fix_socket_payload_limit.md b/docs/development/devlog/2025-12-17-152700_fix_socket_payload_limit.md new file mode 100644 index 0000000..372c510 --- /dev/null +++ b/docs/development/devlog/2025-12-17-152700_fix_socket_payload_limit.md @@ -0,0 +1,12 @@ +# Fix Socket.IO Payload Limit + +## Issue +The user reported a `413 (Payload Too Large)` error when creating a draft room with a full box of 36 packs. This was caused by the default `maxHttpBufferSize` limit (1MB) in Socket.IO, which is insufficient for the large JSON payload generated by 540 cards (36 packs * 15 cards) with full metadata. + +## Resolution +- Modified `src/server/index.ts` to increase `maxHttpBufferSize` to 300MB (3e8 bytes). +- This explicitly sets the limit in the `Server` initialization options. + +## Verification +- `tsx watch` should automatically restart the server. +- The new limit allows for massive payloads, covering the requirement for 36+ packs (requested >250MB). diff --git a/src/server/index.ts b/src/server/index.ts index ae6b63b..a8e32aa 100644 --- a/src/server/index.ts +++ b/src/server/index.ts @@ -17,6 +17,7 @@ const __dirname = path.dirname(__filename); const app = express(); const httpServer = createServer(app); const io = new Server(httpServer, { + maxHttpBufferSize: 300 * 1024 * 1024, // 300MB cors: { origin: "*", // Adjust for production, methods: ["GET", "POST"]