fix(socket): sync deploy button state across collaborators#4206
fix(socket): sync deploy button state across collaborators#4206waleedlatif1 merged 8 commits intostagingfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Adds an internal socket-server endpoint ( Also centralizes socket/ollama URL resolution via new helpers in Reviewed by Cursor Bugbot for commit a6bae8f. Configure here. |
️✅ There are no secrets present in this pull request anymore.If these secrets were true positive and are still valid, we highly recommend you to revoke them. 🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request. |
Greptile SummaryThis PR broadcasts a
Confidence Score: 5/5Safe to merge — the core deploy-button sync works correctly across all stated paths; the remaining finding is a minor completeness gap in the deploy panel's secondary queries. All five deploy paths emit the socket event and handle errors gracefully. The URL utility consolidation is clean and well-documented. The only finding is P2: apps/sim/hooks/use-collaborative-workflow.ts — consider expanding Important Files Changed
Sequence DiagramsequenceDiagram
participant API as Next.js API Route
participant Deploy as orchestration/deploy.ts
participant Socket as Socket Server
participant Room as RoomManager
participant Client as Collaborator Browser
API->>Deploy: performFullDeploy / performFullUndeploy / performActivateVersion
Deploy->>Deploy: update DB deployment state
Deploy->>Socket: POST /api/workflow-deployed
Socket->>Room: handleWorkflowDeployed(workflowId)
Room->>Client: emit workflow-deployed event
Client->>Client: handleWorkflowDeployed(data)
Client->>Client: invalidateDeploymentQueries(queryClient, workflowId)
Note over Client: Refreshes info, deployedState, versions
Note over API,Client: Also triggered by chat PATCH and form POST paths
Reviews (3): Last reviewed commit: "fix(queries): invalidate chat and form s..." | Re-trigger Greptile |
Broadcast workflow-deployed events via socket so all connected users invalidate their deployment query cache when any user deploys, undeploys, activates a version, or triggers a deploy through chat/form endpoints.
Log a warning when the socket server returns a non-2xx status for deployment notifications, matching the pattern in lifecycle.ts.
c743a3e to
6004f8b
Compare
…erUrl/getSocketUrl
Replace all inline `env.SOCKET_SERVER_URL || 'http://localhost:3002'` and
`getEnv('NEXT_PUBLIC_SOCKET_URL') || 'http://localhost:3002'` with centralized
utility functions in urls.ts, matching the getBaseUrl() pattern.
…dcodes Add getOllamaUrl() to urls.ts and replace inline env.OLLAMA_URL fallbacks in the provider and API route. Update CSP to use getSocketUrl(), getOllamaUrl(), and a local toWebSocketUrl() helper instead of hardcoded localhost strings.
|
@greptile |
|
@cursor review |
Update lifecycle, async execute, and chat manage test mocks to include getSocketServerUrl, getOllamaUrl, and notifySocketDeploymentChanged.
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 0daddf6. Configure here.
CSP is loaded by next.config.ts which transpiles outside the @/ alias context. Use local constants instead of importing from urls.ts.
|
@greptile |
|
@cursor review |
Add chatStatus and formStatus to invalidateDeploymentQueries so all deployment-related queries refresh when any user deploys or undeploys.
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit a6bae8f. Configure here.
Summary
workflow-deployedsocket events when deployment state changes so all connected users see the correct deploy button statushandleWorkflowDeployedto socket room managers (memory + Redis), HTTP endpoint, and client-side listenerType of Change
Testing
Tested manually
Checklist