Repository navigation
fix(api): match pause points with jsonb_path_exists so a status-filtered run list stays fast - #9971
Merged
Merged
Conversation
…red run list stays fast
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
[Medium impact] The PR appears safe to merge; no actionable failures were found. SummaryReplaces the per-row pause-point subquery with
Reviews (1) · Last reviewed commit: "fix(api): match pause points with jsonb_..." · Reviewed by Greptile |
Contributor
There was a problem hiding this comment.
1 issue found across 3 files
Confidence score: 3/5
paused-runs.tsdrops points with nopauseKind, even though they should default tohuman; legacy/default paused runs may be missed. Add an explicit missing-pauseKindbranch before the time comparison.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/sim/lib/workflows/executor/paused-runs.ts">
<violation number="1" location="apps/sim/lib/workflows/executor/paused-runs.ts:40">
P2: The human-wait filter drops points with a missing `pauseKind`, instead of applying the documented `human` default. Add an explicit `!exists(@.pauseKind)` branch before the time comparison so legacy/default points remain visible.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
executionStatusinexecution-queries.ts) checked pause points with a correlatedjsonb_each/jsonb_array_elementsunion per row. Unpaged results only compute it for the page, but?status=puts the CASE in theWHERE, so it runs for every run of the workflow. On a workflow with many open pause records, the filtered list went from about 0.25s to 6s warm (25s cold)PAUSE_POINT_ROWSderived table withsomePausePointMatches(filter), ajsonb_path_existscall guarded byjsonb_typeofthat reads both the object and the legacy array shape. The same scan takes about 0.35sresumeStatusreadspaused, and a missing or nullpauseKindreadshumanType of Change
Testing
read-workflow-run-pause.integration.ts(CI) covers settled vs waiting runs in the run list and legacy array rows and time-only exclusion in the paused-runs listChecklist
test-auditauthoring gate)