Skip to content

Conversation

@waleedlatif1
Copy link
Collaborator

Summary

  • add sockets op for renaming blocks

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 Nov 18, 2025

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

1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
docs Skipped Skipped Nov 18, 2025 7:35pm

@waleedlatif1 waleedlatif1 marked this pull request as ready for review November 18, 2025 20:56
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Nov 18, 2025

Greptile Summary

  • Implements socket operations for collaborative block renaming by changing updateBlockName to return structured response with success flag and affected subblocks
  • Removes deprecated migration code including migrateWorkflowToNormalizedTables function and associated tests that converted JSON workflow states to normalized tables
  • Adds cascaded subblock update synchronization in collaborative workflow hook to propagate automatic reference updates when blocks are renamed

Important Files Changed

Filename Overview
apps/sim/stores/workflows/workflow/store.ts Changed updateBlockName return type to include changedSubblocks array for collaborative synchronization
apps/sim/hooks/use-collaborative-workflow.ts Added queuing of cascaded subblock updates to ensure all users see automatic reference changes during block renames

Confidence score: 4/5

  • This PR adds necessary collaborative synchronization for block renaming operations with minimal risk
  • Score reflects well-structured changes that maintain API consistency while removing deprecated code
  • Pay close attention to the collaborative workflow hook to ensure proper socket operation queuing logic

Sequence Diagram

sequenceDiagram
    participant User
    participant CollaborativeWorkflow as "Collaborative Workflow Hook"
    participant WorkflowStore as "Workflow Store"
    participant OperationQueue as "Operation Queue"
    participant SocketIO as "Socket.IO"
    participant RemoteUsers as "Remote Users"

    User->>CollaborativeWorkflow: "collaborativeUpdateBlockName(id, newName)"
    CollaborativeWorkflow->>OperationQueue: "executeQueuedOperation('update-name', 'block', payload, localAction)"
    OperationQueue->>OperationQueue: "addToQueue({ operation: 'update-name', target: 'block', payload })"
    OperationQueue->>WorkflowStore: "localAction() -> updateBlockName(id, newName)"
    WorkflowStore->>WorkflowStore: "Check for normalized name collisions"
    WorkflowStore->>WorkflowStore: "Update block name in state"
    WorkflowStore->>WorkflowStore: "Find and update subblock references with cascading changes"
    WorkflowStore-->>CollaborativeWorkflow: "{ success: true, changedSubblocks: [...] }"
    CollaborativeWorkflow->>OperationQueue: "For each changedSubblock: addToQueue subblock-update operations"
    OperationQueue->>SocketIO: "emitWorkflowOperation('update-name', 'block', payload)"
    SocketIO->>RemoteUsers: "Broadcast block name change operation"
    RemoteUsers->>WorkflowStore: "Apply remote name change locally"
    SocketIO->>OperationQueue: "onOperationConfirmed(operationId)"
    OperationQueue->>OperationQueue: "confirmOperation(operationId)"
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

6 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile
React with 👍 or 👎 to share your feedback on this new summary format

@waleedlatif1 waleedlatif1 merged commit a8a693f into staging Nov 18, 2025
9 checks passed
@waleedlatif1 waleedlatif1 deleted the fix/redeploy branch November 18, 2025 23:57
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