Skip to content

Conversation

@waleedlatif1
Copy link
Collaborator

Summary

  • remove deleted blocks from example curl

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)

@waleedlatif1 waleedlatif1 marked this pull request as ready for review November 7, 2025 23:24
@vercel
Copy link

vercel bot commented Nov 7, 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 7, 2025 11:24pm

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.

Greptile Overview

Greptile Summary

Prevents deleted blocks from appearing in the deploy modal's example curl command by filtering them out during output conversion and adding a cleanup effect.

Key Changes:

  • Modified getInputFormatExample() to return null for deleted blocks and filter them out before generating the curl command
  • Added validation for both UUID-based (blockId_attribute) and blockName.attribute formats
  • Introduced a new useEffect hook that automatically cleans up selectedStreamingOutputs when blocks are deleted
  • Ensures the example curl only includes valid, existing blocks

Confidence Score: 5/5

  • Safe to merge with no issues
  • Clean bug fix with proper validation, defensive programming, and no breaking changes
  • No files require special attention

Important Files Changed

File Analysis

Filename Score Overview
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/control-bar/components/deploy-modal/deploy-modal.tsx 5/5 Added filtering to remove deleted blocks from streaming outputs in example curl and added cleanup effect

Sequence Diagram

sequenceDiagram
    participant User
    participant DeployModal
    participant WorkflowStore
    participant API
    
    User->>DeployModal: Opens deploy modal
    DeployModal->>WorkflowStore: getState().blocks
    DeployModal->>DeployModal: Filter selectedStreamingOutputs
    
    Note over DeployModal: Check each output ID
    
    alt UUID-based format (blockId_attribute)
        DeployModal->>WorkflowStore: Find block by ID
        alt Block found
            DeployModal->>DeployModal: Convert to blockName.attribute
        else Block deleted
            DeployModal->>DeployModal: Return null (filter out)
        end
    else blockName.attribute format
        DeployModal->>WorkflowStore: Find block by name
        alt Block not found (deleted)
            DeployModal->>DeployModal: Return null (filter out)
        else Block exists
            DeployModal->>DeployModal: Keep output ID
        end
    end
    
    DeployModal->>DeployModal: Filter out nulls
    DeployModal->>API: Generate example curl with valid outputs only
    DeployModal->>User: Display curl command
Loading

1 file reviewed, no comments

Edit Code Review Agent Settings | Greptile

@waleedlatif1 waleedlatif1 merged commit d3e81e9 into staging Nov 7, 2025
9 checks passed
@waleedlatif1 waleedlatif1 deleted the sim-362 branch November 7, 2025 23:27
@waleedlatif1 waleedlatif1 mentioned this pull request Nov 12, 2025
10 tasks
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