⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

Conversation

@waleedlatif1
Copy link
Collaborator

Summary

remove duplicate effect that cleared subblocks on cred change

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 Jan 13, 2026

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

1 Skipped Deployment
Project Deployment Review Updated (UTC)
docs Skipped Skipped Jan 13, 2026 8:46am

@waleedlatif1 waleedlatif1 merged commit 6717ce8 into staging Jan 13, 2026
6 checks passed
@waleedlatif1 waleedlatif1 deleted the fix/slack branch January 13, 2026 08:47
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 13, 2026

Greptile Overview

Greptile Summary

This PR removes a useEffect hook from the WorkflowBlock component that was clearing all credential-dependent subblock values whenever the credential field changed. The removed effect tracked credential changes using a ref and cleared all non-credential subblock fields when a credential changed (after the initial mount).

What changed:

  • Removed 29 lines of code including a useEffect that monitored credential subblock changes
  • Removed unused import of useCollaborativeWorkflow hook
  • The effect was clearing dependent fields by iterating through all subblock keys and setting them to empty strings

Why this is a duplicate:
The PR title and description indicate this was duplicate logic. Based on the codebase structure, credential-dependent field clearing is likely handled elsewhere - potentially in:

  1. The CredentialSelector component itself (lines 145-152 show it clears invalid selections)
  2. The useSubBlockValue hook which handles model/provider changes and API key clearing (lines 172-188)
  3. Individual selector components that depend on credentials

The removed logic was overly aggressive - it cleared ALL subblocks except credential itself, which could have unintended side effects on fields that don't depend on credentials.

Confidence Score: 5/5

  • Safe to merge - clean removal of duplicate logic with no breaking changes
  • This is a straightforward removal of duplicate code. The effect being removed was clearing all subblock fields when credentials changed, which is functionality that should be (and likely is) handled by the individual credential-dependent components themselves. The removal includes the unused import, keeping the code clean. No tests are modified because this is a bug fix removing redundant behavior.
  • No files require special attention

Important Files Changed

File Analysis

Filename Score Overview
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/workflow-block/workflow-block.tsx 5/5 Removed duplicate credential change effect that cleared all subblocks. Clean removal with no issues - the logic is handled elsewhere in the codebase.

Sequence Diagram

sequenceDiagram
    participant User
    participant WorkflowBlock
    participant CredentialSelector
    participant SubBlockStore
    
    Note over WorkflowBlock: Before this PR
    User->>CredentialSelector: Change credential
    CredentialSelector->>SubBlockStore: Update credential value
    WorkflowBlock->>SubBlockStore: Detect credential change
    WorkflowBlock->>SubBlockStore: Clear ALL dependent fields
    Note over WorkflowBlock: Problem: Duplicate clearing logic
    
    Note over WorkflowBlock: After this PR
    User->>CredentialSelector: Change credential
    CredentialSelector->>SubBlockStore: Update credential value
    Note over CredentialSelector: Handles clearing internally
    Note over WorkflowBlock: No longer involved in clearing
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.

No files reviewed, no comments

Edit Code Review Agent Settings | Greptile

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