Skip to content

Commit 98c52f0

Browse files
committed
fix(logging): make workflowId required in markExecutionAsFailed
Making workflowId optional left a footgun — future callers could silently omit it and the WHERE clause would degrade to executionId-only, losing the cross-tenant scoping guarantee. All callers already supply workflowId, so making it required (with string | undefined for the middle params to keep call sites unchanged) closes the gap without touching any caller.
1 parent 3e9a5ad commit 98c52f0

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

apps/sim/lib/logs/execution/logging-session.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1090,9 +1090,9 @@ export class LoggingSession {
10901090

10911091
static async markExecutionAsFailed(
10921092
executionId: string,
1093-
errorMessage?: string,
1094-
requestId?: string,
1095-
workflowId?: string
1093+
errorMessage: string | undefined,
1094+
requestId: string | undefined,
1095+
workflowId: string
10961096
): Promise<void> {
10971097
try {
10981098
const message = errorMessage || 'Run failed'
@@ -1118,7 +1118,7 @@ export class LoggingSession {
11181118
.where(
11191119
and(
11201120
eq(workflowExecutionLogs.executionId, executionId),
1121-
workflowId ? eq(workflowExecutionLogs.workflowId, workflowId) : undefined
1121+
eq(workflowExecutionLogs.workflowId, workflowId)
11221122
)
11231123
)
11241124

0 commit comments

Comments
 (0)