Files
sim/apps
Waleed 1ce2aef19a fix(triggers): stop cloned trigger blocks reusing the source's webhook URL (#6091)
Before a deploy, a trigger block's webhook URL is DERIVED — useWebhookManagement
and the canvas both fall back to the block's own id, which cloning already
regenerates, so copying an undeployed trigger yields a fresh URL. Deploy then
registers the webhook at `path = triggerPath || block.id` and writes that literal
path back into the source block's `triggerPath`. From then on the URL is STORED,
and copy/paste copies it verbatim, so the clone renders the source's URL.

Clear `triggerPath` on in-canvas clones so the clone derives a path from its new
block id again.

- Clears both the subBlocks structure and the sub-block value map: the value map
  is authoritative in mergeSubblockStateWithValues, and since no trigger declares
  `triggerPath` as a subblock it normally lives only in the store.
- Deliberately unconditional and limited to `triggerPath`. No block declares that
  id, so there is nothing to collide with and no need to classify the block.
- The sibling TRIGGER_RUNTIME_SUBBLOCK_IDS entries are left alone on purpose.
  `triggerConfig`/`triggerId` are user configuration. `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, since deploy mints its own row id and
  matches existing rows by block id.

Scoped to the clone paths. No deploy-side, server-side, or import/export change.
2026-07-29 23:03:24 -07:00
..