Skip to content

Conversation

@waleedlatif1
Copy link
Collaborator

Summary

  • Fix false positive "changes detected" for deployed trigger blocks (e.g., Slack webhook)
  • Add triggerId to runtime subblock exclusion list
  • Fix prefix matching for namespaced system subblock IDs (e.g., samplePayload_slack_webhook)
  • Add normalizeTriggerConfigValues to populate null fields from triggerConfig before comparison
  • Inject triggerConfig into current state for trigger-mode blocks
  • Add 27 new tests covering all edge cases

Type of Change

  • Bug fix

Testing

  • 206 tests passing (27 new)
  • TypeScript compiles clean
  • 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 Feb 12, 2026

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Feb 12, 2026 1:11am

Request Review

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 12, 2026

Greptile Overview

Greptile Summary

Fixed false positive "changes detected" for deployed trigger blocks by normalizing trigger configuration values before comparison. The PR addresses the issue where deployed state stores null/empty values for individual trigger fields (like signingSecret, botToken) while the client runtime populates these from the triggerConfig aggregate object, causing the comparison to incorrectly detect changes.

Key changes:

  • Added normalizeTriggerConfigValues function that populates null/empty individual trigger fields from triggerConfig before comparison
  • Enhanced filterSubBlockIds to use prefix matching for namespaced system subblock IDs (e.g., samplePayload_slack_webhook)
  • Added triggerId to runtime subblock exclusion list
  • Injected triggerConfig into current state in use-change-detection.ts for trigger-mode blocks
  • Added 27 comprehensive tests covering all edge cases

The solution ensures both deployed and current states are normalized consistently before diffing, preventing false positives while still detecting real user changes.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The implementation is well-designed with defensive programming practices, comprehensive test coverage (27 new tests covering all edge cases), and clear documentation. The changes are isolated to comparison logic and maintain backward compatibility. All tests pass and TypeScript compiles cleanly.
  • No files require special attention

Important Files Changed

Filename Overview
apps/sim/triggers/constants.ts Added triggerId to TRIGGER_RUNTIME_SUBBLOCK_IDS exclusion list
apps/sim/lib/workflows/comparison/normalize.ts Added prefix matching for namespaced system subblock IDs and normalizeTriggerConfigValues function to populate null fields from triggerConfig
apps/sim/lib/workflows/comparison/compare.ts Integrated normalizeTriggerConfigValues into comparison logic to normalize both current and deployed states before diffing
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/hooks/use-change-detection.ts Injected triggerConfig into current state for trigger-mode blocks to ensure consistent comparison

Sequence Diagram

sequenceDiagram
    participant UI as Deploy Panel
    participant Hook as useChangeDetection
    participant Compare as hasWorkflowChanged
    participant Normalize as normalizeTriggerConfigValues
    participant Filter as filterSubBlockIds

    UI->>Hook: Request change detection
    Hook->>Hook: Build current state with triggerConfig
    Note over Hook: Inject triggerConfig for trigger-mode blocks
    Hook->>Compare: Compare current vs deployed
    Compare->>Normalize: Normalize deployed subBlocks
    Note over Normalize: Populate null fields from triggerConfig
    Compare->>Normalize: Normalize current subBlocks
    Note over Normalize: Populate null fields from triggerConfig
    Compare->>Filter: Get comparable subBlock IDs
    Note over Filter: Exclude triggerId, triggerConfig, webhookId<br/>Exclude namespaced system IDs (samplePayload_*)
    Filter-->>Compare: Filtered IDs
    Compare->>Compare: Diff normalized values
    Compare-->>Hook: Change detected: true/false
    Hook-->>UI: Display changes status
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, no comments

Edit Code Review Agent Settings | Greptile

@waleedlatif1 waleedlatif1 merged commit 01577a1 into staging Feb 12, 2026
12 checks passed
@waleedlatif1 waleedlatif1 deleted the improvement/change-detection branch February 12, 2026 01:24
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.

1 participant