ChangelogMarch 14, 2025

Changelog - WebSocket Server & Client Updates

[2025-03-14]

Added

  • 🚀 New Feature: Default Model Prompt Selection
    Users can now choose to include or exclude the default model prompt when submitting input. The UI has been updated to allow selection from approved model prompts.

  • 🚀 New Feature: Standalone WebSocket Server Structure
    A new project directory structure has been established using Node.js and TypeScript, featuring a basic Express server with Socket.IO integration, a health check endpoint, and Clerk-based authentication middleware. A Procfile has been added for deployment on DigitalOcean App Platform.

  • 🚀 New Feature: Extraction of WebSocket Functionality
    WebSocket-related code has been migrated from the Next.js application to the standalone server. This includes a robust job tracking system with events for job creation, updates, completion, failure, and progress reporting, plus webhook endpoints for external job updates.

  • 🚀 New Feature: Client-Side Integration Updates
    The Socket.IO hook in the client application now connects to the external WebSocket server, and API endpoints in Next.js have been revised to forward job updates via the new webhook.

  • 🚀 New Feature: Deployment Enhancements
    The repository has been updated with new build/run scripts, environment configurations, and Docker settings. CORS has been configured to allow secure communication with the Vercel-hosted frontend. The WebSocket server is now deployed on DigitalOcean with auto-scaling options.

  • 🚀 New Feature: Testing & Monitoring
    Automated tests have been implemented using Vitest and Supertest, load testing conducted via Artillery, and an admin monitoring dashboard has been added to track active connections, job processing rates, error rates, and server uptime.

Changed

  • 🔧 Enhancement: Client Code
    API endpoints have been updated to utilize the external WebSocket server instead of a local instance.

  • 🔧 Enhancement: Job Polling Logic
    Polling logic has been modified to prevent infinite loops for stale jobs and to improve subscription handling for reconnections.

Fixed

  • 🐛 Bug Fix: Stale Job Handling & Infinite Polling
    Implemented logic to automatically mark jobs older than 1 hour as complete (if an image exists) or timed out (if not), and resolved type errors in webhook data handling by properly managing null values.

Improved

  • 🔧 Enhancement: Code Quality and Performance
    Upgraded TypeScript and ESLint configurations for improved maintainability, optimized real-time data handling and job processing for better scalability, and updated documentation (README, ROLLBACK, LIMITATIONS) for smoother deployment, monitoring, and troubleshooting.