Skip to content

Conversation

@waleedlatif1
Copy link
Collaborator

Summary

  • add logger package to realtime dockerfile

Type of Change

  • Bug fix

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link

vercel bot commented Dec 28, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
docs Ready Ready Preview, Comment Dec 28, 2025 1:53am

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Dec 28, 2025

Greptile Summary

Added the missing packages/logger copy step to the realtime Dockerfile runner stage. The socket server (apps/sim/socket/index.ts) imports @sim/logger and uses it extensively across 12 files for logging connection events, errors, and HTTP requests. Without this package being copied to the runtime container, the socket server would fail at startup with a module resolution error.

The fix follows the existing pattern established in the Dockerfile where packages/db is already copied (line 63), placing the logger package copy right after it before the sim app copy. The deps and builder stages already included the logger package, so only the runner stage was missing this dependency.

  • Fixed missing workspace dependency that would cause runtime failure
  • Maintains proper Docker layer caching by placing the logger package copy between db package and sim app
  • Consistent with the deps stage which already includes logger package configuration

Confidence Score: 5/5

  • This PR is safe to merge - it fixes a critical runtime dependency issue
  • The change adds a missing workspace package that is required by the socket server. The socket server imports @sim/logger in 12 files, and without this copy step, the Docker container would fail at runtime. The fix follows the exact pattern already established for the db package and maintains proper Docker layer ordering for cache efficiency.
  • No files require special attention

Important Files Changed

Filename Overview
docker/realtime.Dockerfile Added missing logger package copy to fix runtime dependency issue in socket server

Sequence Diagram

sequenceDiagram
    participant Builder as Builder Stage
    participant Runner as Runner Stage
    participant SocketServer as Socket Server
    participant Logger as @sim/logger
    
    Note over Builder,Runner: Docker Build Process
    Builder->>Builder: Copy packages/logger to /app/packages/logger
    Builder->>Runner: COPY packages/db to runner
    Builder->>Runner: COPY packages/logger to runner (NEW FIX)
    Builder->>Runner: COPY apps/sim to runner
    
    Note over Runner,Logger: Runtime Execution
    Runner->>SocketServer: Execute: bun apps/sim/socket/index.ts
    SocketServer->>Logger: import { createLogger } from '@sim/logger'
    
    alt Without Fix
        Logger--xSocketServer: Module not found error
        SocketServer--xRunner: Startup failure
    end
    
    alt With Fix
        Logger->>SocketServer: Return logger instance
        SocketServer->>Logger: logger.info() across 12 files
        SocketServer->>Runner: Successful startup
    end
Loading

@waleedlatif1 waleedlatif1 merged commit cdc1a83 into staging Dec 28, 2025
11 checks passed
@waleedlatif1 waleedlatif1 deleted the fix/build branch December 28, 2025 01:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants