Title: fix(triggers): stop cloned trigger blocks reusing the source's webhook URL by waleedlatif1 · Pull Request #6091 · simstudioai/sim · GitHub
Open Graph Title: fix(triggers): stop cloned trigger blocks reusing the source's webhook URL by waleedlatif1 · Pull Request #6091 · simstudioai/sim
X Title: fix(triggers): stop cloned trigger blocks reusing the source's webhook URL by waleedlatif1 · Pull Request #6091 · simstudioai/sim
Description: Summary Copy/pasting or duplicating a deployed webhook trigger block gave the clone the source's webhook URL instead of a fresh one. The precondition is deploy, which is what made it look intermittent: Before deploy the URL is derived. use-webhook-management.ts:103-109 and the canvas both fall back to ${baseUrl}/api/webhooks/trigger/${blockId}, and cloning already regenerates block ids — so copying an undeployed trigger yields a fresh URL on its own. After deploy the URL is stored. Deploy registers the webhook at path = triggerPath || block.id (deploy.ts:321-325) and the effect at use-webhook-management.ts:151 writes that literal path back into the source's triggerPath. Paste copies the string verbatim, the clone stops deriving, and it renders the source's URL. Fix: clear triggerPath on in-canvas clones so the clone derives from its new block id again. Two lines of behavior, one new function. Clears both the subBlocks structure and the sub-block value map. The value map is authoritative in mergeSubblockStateWithValues (a null there overrides the structure), and since no trigger declares triggerPath as a subblock it normally lives only in the store. Clearing one without the other leaves the source's path in effect. Deliberately unconditional, and limited to triggerPath. Zero blocks declare that subblock id, so there is nothing to collide with and no need to classify the block first — no predicate, no gate. The sibling TRIGGER_RUNTIME_SUBBLOCK_IDS entries are left alone on purpose. triggerConfig/triggerId are user configuration (and triggerConfig can be a legacy trigger's only config home). webhookId is a user-entered action field on Attio, Vercel, and Discord — and Attio/Vercel are trigger-capable, so clearing it by trigger-ness would destroy real config — while being unused as trigger state: deploy mints its own row id via generateShortId() and matches existing rows by block id, and useWebhookManagement overwrites the field from the server anyway. Scope Clone paths only. No deploy-side, server-side, or import/export behavior change — regenerateWorkflowIds (export/import), sanitizeSubBlocksForDuplicate (server duplicate + workspace forking), and the copilot edit path are untouched. Type of Change Bug fix Testing 8610 tests pass across stores + lib + triggers (612 files); tsc --noEmit clean; check:boundaries, check:realtime-prune, check:client-boundary, check:api-validation, check:utils all pass; biome clean. Verified non-vacuous by mutation testing — zero coverage holes. Every mutation is caught, including two that would re-introduce a regression: Mutation Tests failed Drop the structure clear 4 Drop the value-map clear 5 Helper early-return 6 Delete the regenerateBlockIds call site 5 Delete the duplicateBlock call site 1 Also clear webhookId (would wipe Attio/Vercel config) 4 Also clear triggerConfig (would drop trigger setup) 1 Write undefined instead of null 5 Coverage includes both triggerMode: true (the shape the toolbar actually creates — confirmed against production rows) and triggerMode: false (API/import rows), the value-map-only shape, the structure-only shape, and explicit preservation tests for webhookId on both a trigger-capable block in trigger mode and an action block. 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)
Open Graph Description: Summary Copy/pasting or duplicating a deployed webhook trigger block gave the clone the source's webhook URL instead of a fresh one. The precondition is deploy, which is what made it look inter...
X Description: Summary Copy/pasting or duplicating a deployed webhook trigger block gave the clone the source's webhook URL instead of a fresh one. The precondition is deploy, which is what made it look i...
Opengraph URL: https://github.com/simstudioai/sim/pull/6091
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:5f4c83ec-8e42-63e5-7769-8ee0fe63d33e |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 95C6:1B6493:50609B:6F2F52:6AFB3C0C |
| html-safe-nonce | 07fb04c671236d954c21fe610d5e176fe7ce5c2420469439414f7ceb627cc7ea |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NUM2OjFCNjQ5Mzo1MDYwOUI6NkYyRjUyOjZBRkIzQzBDIiwidmlzaXRvcl9pZCI6IjY0ODA3MDM1NzI3NzQyNDY1MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 388e8c9d47ece77d752bd648e983ec4d32cdfcb0f15ed09defdc7ccc9058254a |
| hovercard-subject-tag | pull_request:4166614238 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/simstudioai/sim/pull/6091/files |
| twitter:image | https://avatars.githubusercontent.com/u/40672544?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/40672544?s=400&v=4 |
| og:image:alt | Summary Copy/pasting or duplicating a deployed webhook trigger block gave the clone the source's webhook URL instead of a fresh one. The precondition is deploy, which is what made it look inter... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 2169b0dfbef67ed6b128074a5ed45bb7d5d1859783b10178b09a7765ad5f3693 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/simstudioai/sim git https://github.com/simstudioai/sim.git |
| octolytics-dimension-user_id | 199344406 |
| octolytics-dimension-user_login | simstudioai |
| octolytics-dimension-repository_id | 912559512 |
| octolytics-dimension-repository_nwo | simstudioai/sim |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 912559512 |
| octolytics-dimension-repository_network_root_nwo | simstudioai/sim |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 3b4fc8df5ef1c6757e733a23e6b81b6725021823 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width