improvement(mothership): workflow edits via sockets#3927
improvement(mothership): workflow edits via sockets#3927icecrasher321 merged 4 commits intostagingfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Adds a new Server-side workflow edits (Copilot Reviewed by Cursor Bugbot for commit 93197f1. Configure here. |
Greptile SummaryThis PR adds real-time workflow state synchronisation for the mothership embedded view: when a copilot AI tool edits a workflow, the Key changes:
Confidence Score: 4/5Safe to merge after addressing the missing undo/redo pruning, which can corrupt the undo history after an external workflow update. One P1 finding: handleWorkflowUpdated skips the pruneInvalidEntries step that handleWorkflowReverted correctly performs, leaving the undo/redo stack with references to blocks/edges that may no longer exist. One P2 finding: no fetch timeout on the socket notification could add latency to the copilot tool. The socket-provider changes are clean and correct. apps/sim/hooks/use-collaborative-workflow.ts — missing undo/redo pruning after external workflow state replacement. Important Files Changed
Sequence DiagramsequenceDiagram
participant Copilot as Copilot Tool (Server)
participant DB as Database
participant Socket as Socket Server
participant Provider as SocketProvider (Client)
participant Hook as useCollaborativeWorkflow
participant Store as WorkflowStore / SubBlockStore
Copilot->>DB: saveWorkflowToNormalizedTables()
DB-->>Copilot: success
Copilot->>Socket: POST /api/workflow-updated { workflowId }
Socket-->>Copilot: 200 OK
Socket->>Provider: emit('workflow-updated', { workflowId })
Provider->>Hook: eventHandlers.workflowUpdated(data)
Hook->>Hook: check activeWorkflowId & hasActiveDiff
Hook->>DB: GET /api/workflows/{workflowId}
DB-->>Hook: { data: { state: { blocks, edges, ... } } }
Hook->>Store: replaceWorkflowState(...)
Hook->>Store: useSubBlockStore.setState(subblockValues)
Note over Hook,Store: pruneInvalidEntries() missing here
Reviews (1): Last reviewed commit: "improvement(mothership): workflow edits ..." | Re-trigger Greptile |
apps/sim/lib/copilot/tools/server/workflow/edit-workflow/index.ts
Outdated
Show resolved
Hide resolved
|
bugbot run |
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 79476dd. Configure here.
|
bugbot run |
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 93197f1. Configure here.
* improvement(mothership): workflow edits via sockets * make embedded view join room * fix cursor positioning bug
Summary
Workflow edits persistence via sockets for mothership embedded view.
Type of Change
Testing
Tested manually
Checklist