refactor(triggers): consolidate v2 Linear triggers into same files as v1#4010
refactor(triggers): consolidate v2 Linear triggers into same files as v1#4010waleedlatif1 merged 11 commits intostagingfrom
Conversation
Move v2 trigger exports from separate _v2.ts files into their corresponding v1 files, matching the block v2 convention where LinearV2Block lives alongside LinearBlock in the same file.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Consolidates Linear v2 trigger definitions by moving v2 Improves webhook deduplication support by adding Simplifies chat queued-message sending so pressing Enter with an empty input while sending immediately dispatches the top queued message (removing the prior “prime then confirm” behavior and related Reviewed by Cursor Bugbot for commit ca3c7d0. Configure here. |
Greptile SummaryThis PR consolidates 15 separate
The PR also includes changes to Key changes:
Confidence Score: 5/5Safe to merge — the trigger consolidation is a clean structural refactor with no functional changes; all identified issues are minor style violations All four findings are P2 style issues (any vs unknown types) in the idempotency service. The core trigger consolidation is correct: named exports match, the barrel is complete, and generate-docs handles multi-export files properly via the exportStarts slicing approach. No functional regressions are expected from the refactor itself. apps/sim/lib/core/idempotency/service.ts — four any-type violations in IdempotencyResult, ProcessingResult, normalizeKey, and createWebhookIdempotencyKey that should use unknown Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["trigger file\ne.g. issue_created.ts"] -->|exports| B["linearIssueCreatedTrigger\nv1.0.0"]
A -->|exports| C["linearIssueCreatedV2Trigger\nv2.0.0"]
D["index.ts barrel"] -->|re-exports both| A
E["triggers/registry.ts"] -->|registers all| D
F["generate-docs.ts\nbuildTriggerRegistry"] -->|scans trigger .ts files| G{"multiple TriggerConfig\nexports in file?"}
G -->|yes - split on exportStarts| H["parse each segment\nindependently"]
G -->|no - single export| I["parse whole file"]
H --> J["TriggerInfo registry map"]
I --> J
J --> K["integrations.json"]
Reviews (2): Last reviewed commit: "idempotency" | Re-trigger Greptile |
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The buildTriggerRegistry function used a single regex exec per file, which only captured the first TriggerConfig export. Files that export both v1 and v2 triggers (consolidated same-file convention) had their v2 triggers silently dropped from integrations.json. Split each file into segments per export and parse each independently. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Restores the staging version of linear provider handler and trigger utils that were accidentally regressed. Key restorations: - teamId sub-block and allPublicTeams fallback in createSubscription - Timestamp skew validation in verifyAuth - actorType renaming in formatInput (avoids TriggerOutput collision) - url field in formatInput and all output builders - edited field in comment outputs - externalId validation after webhook creation - isLinearEventMatch returns false (not true) for unknown triggers Adds extractIdempotencyId to the linear provider handler for webhook deduplication support. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The idempotency service already uses the Linear-Delivery header (which Linear always sends) as the primary dedup key. The body-based fallback was unnecessary defensive code. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
@greptile |
|
@cursor review |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit ca3c7d0. Configure here.

Summary
_v2.tsfiles into their corresponding v1 trigger filesLinearV2Blocklives alongsideLinearBlockinlinear.ts)_v2.tsfiles, update barrel exports inindex.tsType of Change
Testing
Tested manually — type-check and lint pass clean
Checklist