Repository navigation
fix(workflows): refuse operation edits that would overwrite a concurrent change - #9902
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
[Medium impact] The PR appears safe to merge; no blocking issues remain. SummaryWorkflow operation writes now check the stored graph under the row lock and refuse stale edits.
Reviews (2) · Last reviewed commit: "fix(workflows): fingerprint only stored ..." · Reviewed by Greptile |
There was a problem hiding this comment.
1 issue found across 3 files
Confidence score: 4/5
- In
apply-workflow-operations.ts, large or legacy workflows can hold the row lock longer while the migrated graph is loaded and normalized. Keep the lock around the staleness read if possible.
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/application/apply-workflow-operations.ts">
<violation number="1" location="apps/sim/lib/workflows/application/apply-workflow-operations.ts:262">
P2: The row lock now covers the full migrated graph load, including conditional credential lookups and graph-wide normalization, rather than just a short staleness read. Large or legacy workflows can therefore hold the workflow lock during avoidable work and make concurrent edits wait; use a lock-safe raw/canonical fingerprint read that does not run the migration pipeline under the lock.</violation>
</file>
… cannot raise a false conflict
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
1 issue found across 4 files
Confidence score: 2/5
- In
apply-workflow-operations.ts, delegated edits with a suppliedbaseGraphcan overwrite concurrent v2 or builder changes because they bypass the conflict guard. Capture and validate the stored fingerprint before writing.
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/application/apply-workflow-operations.ts">
<violation number="1" location="apps/sim/lib/workflows/application/apply-workflow-operations.ts:250">
P1: Delegated edits with a supplied `baseGraph` bypass the new conflict guard. Because the write path sees no `storedFingerprint`, a Copilot edit can still overwrite a concurrent v2 or builder change; capture and validate a stored fingerprint for this path (or reject stale caller bases) before writing.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
Summary
POST /api/v2/workflows/{id}/operationscalls (or v2 and Copilot, or v2 and someone editing in the builder) could silently drop each other's edits.409 conflictif another edit committed after the base read. The caller re-reads and retries; nothing is lost silently.atomic, skipped-item reporting, lint, minted IDs, audit, andPUT /state.Test plan