Skip to content

chore(triggers): deprecate trigger-save subblock#4107

Open
waleedlatif1 wants to merge 2 commits intostagingfrom
waleedlatif1/deprecate-trigger-save
Open

chore(triggers): deprecate trigger-save subblock#4107
waleedlatif1 wants to merge 2 commits intostagingfrom
waleedlatif1/deprecate-trigger-save

Conversation

@waleedlatif1
Copy link
Copy Markdown
Collaborator

Summary

  • Remove the defunct triggerSave subblock from all 102 trigger definitions across every provider
  • Remove trigger-save from SubBlockType union, SYSTEM_SUBBLOCK_IDS, tool params, and command templates
  • Retain the backwards-compat filter in getTrigger() to safely handle any legacy stored data

Type of Change

  • Refactor / cleanup (no behavior change)

Testing

  • All 76 block tests pass
  • tsc --noEmit passes with zero errors
  • Lint passes clean

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)

Remove the defunct triggerSave subblock from all 102 trigger definitions,
the SubBlockType union, SYSTEM_SUBBLOCK_IDS, tool params, and command
templates. Retain the backwards-compat filter in getTrigger() for any
legacy stored data.
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 11, 2026

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Apr 11, 2026 4:01pm

Request Review

@cursor
Copy link
Copy Markdown

cursor bot commented Apr 11, 2026

PR Summary

Low Risk
Low risk refactor that removes a defunct UI-only subblock type from trigger definitions and related type lists; main risk is minor UI/regression if any legacy workflow still expects triggerSave to render, mitigated by filtering in getTrigger().

Overview
Removes the legacy triggerSave/trigger-save subblock from trigger configuration across providers and updates Sim’s type/system lists accordingly (e.g., SubBlockType, SYSTEM_SUBBLOCK_IDS, tool param exclusions, block tests, and trigger authoring templates).

Keeps backward compatibility by filtering out any stored legacy trigger-save subblocks when loading triggers via getTrigger(). Also includes a small bun.lock metadata update (configVersion).

Reviewed by Cursor Bugbot for commit d0a522c. Configure here.

@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@cursor review

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Apr 11, 2026

Greptile Summary

This PR removes the defunct triggerSave subblock from all 102 trigger definitions, strips trigger-save from the SubBlockType union and SYSTEM_SUBBLOCK_IDS, cleans up related command templates, and retains a backwards-compatibility filter in getTrigger() to safely discard any triggerSave subblocks still held in persisted workflow state.

The implementation is correct and complete. One minor orphaned property remains in SubBlockConfig.

Confidence Score: 5/5

Safe to merge — pure cleanup with a correct backwards-compat shim; no behaviour change.

All 102 trigger definitions cleaned, type union updated, command templates updated, and legacy data is handled gracefully by the filter in getTrigger(). The only finding is a P2 orphaned property with a stale comment — not a correctness issue.

apps/sim/blocks/types.ts — minor orphaned triggerId? property cleanup

Important Files Changed

Filename Overview
apps/sim/triggers/index.ts Backwards-compat filter correctly strips any triggerSave subblocks from legacy stored data in getTrigger(); buildTriggerSubBlocks no longer emits a save button subblock
apps/sim/blocks/types.ts trigger-save removed from SubBlockType union; orphaned triggerId? property with stale "Trigger-save specific" comment remains in SubBlockConfig
apps/sim/triggers/constants.ts triggerSave correctly removed from SYSTEM_SUBBLOCK_IDS; no other changes needed
apps/sim/tools/params.ts No trigger-save in EXCLUDED_SUBBLOCK_TYPES; consistent with type removal since trigger-mode subblocks are already filtered by mode check before type filtering
apps/sim/triggers/linear/utils.ts No-op blocks.push() removed (second commit fix); buildLinearV2SubBlocks is clean
.claude/commands/add-trigger.md Command template updated — no more references to triggerSave or trigger-save; setup instructions example updated accordingly

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[getTrigger called] --> B[Look up trigger in TRIGGER_REGISTRY]
    B --> C[Filter subBlocks]
    C --> D{"id === 'triggerSave' OR\ntype === 'trigger-save'?"}
    D -- Yes --> E[Discard — legacy backwards-compat]
    D -- No --> F[Keep subBlock]
    F --> G[namespaceSubBlockId]
    G --> H[Inject samplePayload if webhook/poller]
    H --> I[Return cloned TriggerConfig]
    E --> G
Loading

Comments Outside Diff (1)

  1. apps/sim/blocks/types.ts, line 413-414 (link)

    P2 Orphaned triggerId? property and stale comment

    trigger-save was removed from SubBlockType in this PR, making the triggerId property on SubBlockConfig dead code — no subblock definition anywhere in the codebase sets this property, and no rendering path reads it. The comment ("Trigger-save specific: The trigger ID for validation and saving") is also now misleading.

    Consider removing lines 413–414 entirely.

Reviews (1): Last reviewed commit: "fix(triggers): remove leftover no-op blo..." | Re-trigger Greptile

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

✅ 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 d0a522c. Configure here.

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