Skip to content

Commit ddda582

Browse files
committed
fix(triggers): conceal a workflow-less trigger row as not found
1 parent b682487 commit ddda582

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

‎apps/sim/lib/workflows/application/triggers.ts‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,9 @@ async function resolveTriggerTargetContext({
9393
const { table } = target
9494
const notFoundMessage = table === 'schedule' ? 'Schedule not found' : 'Webhook not found'
9595
const row = await findTriggerRowOwner(table, target.id)
96-
if (!row) throw new OrchestrationError('not_found', notFoundMessage)
97-
if (!row.workflowId) {
98-
throw new OrchestrationError('validation', 'Schedule has no associated workflow')
99-
}
100-
if (!row.blockId) throw new OrchestrationError('not_found', notFoundMessage)
96+
// A row with no workflow or block is never switchable, and answering before the tenant check
97+
// must not tell a caller anything beyond what a missing row would.
98+
if (!row?.workflowId || !row.blockId) throw new OrchestrationError('not_found', notFoundMessage)
10199
const workflowContext = await resolveActiveWorkflowApplicationContext({
102100
workflowId: row.workflowId,
103101
})

0 commit comments

Comments
 (0)