Skip to content

Commit 2f249ca

Browse files
committed
fix(logs): exclude job logs when level filter is workflow-only
When level=running or level=pending (workflow-only states involving endedAt/pausedExecutions semantics), jobLevelConditions stayed empty so no level constraint reached jobConditions — every job log in the workspace leaked into the result. Skip the job side entirely when the level filter has no job-applicable values (error/info).
1 parent ff938c7 commit 2f249ca

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

apps/sim/app/api/logs/route.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,11 @@ export const GET = withRouteHandler(async (request: NextRequest) => {
175175
const triggersList = params.triggers?.split(',').filter(Boolean) || []
176176
const triggersExcludeJobs =
177177
triggersList.length > 0 && !triggersList.includes('all') && !triggersList.includes('mothership')
178-
const includeJobLogs = !hasWorkflowSpecificFilters && !triggersExcludeJobs
178+
const levelList =
179+
params.level && params.level !== 'all' ? params.level.split(',').filter(Boolean) : []
180+
const levelExcludesJobs =
181+
levelList.length > 0 && !levelList.some((l) => l === 'error' || l === 'info')
182+
const includeJobLogs = !hasWorkflowSpecificFilters && !triggersExcludeJobs && !levelExcludesJobs
179183

180184
const workflowQuery = db
181185
.select({

0 commit comments

Comments
 (0)