GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(workflows): refuse operation edits that would overwrite a concurrent change by waleedlatif1 · Pull Request #9902 · simstudioai/sim

Conversation

@waleedlatif1

@waleedlatif1 waleedlatif1 commented Nov 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Applying workflow operations read the stored graph outside the workflow row lock, applied the batch in memory, then wrote the whole graph back. Two concurrent POST /api/v2/workflows/{id}/operations calls (or v2 and Copilot, or v2 and someone editing in the builder) could silently drop each other's edits.
  • The write now re-reads the stored graph under the row lock and refuses with a 409 conflict if another edit committed after the base read. The caller re-reads and retries; nothing is lost silently.
  • Applying the batch stays outside the lock on purpose: it does credential lookups, MCP server discovery, and lint queries, which must not run while holding the row lock (and would trip the transaction tripwire). Only one indexed graph read and a fingerprint comparison run under the lock.
  • The fingerprint is order-insensitive (sorted keys, edges sorted by id) because the loader doesn't order rows.
  • Unchanged: Copilot's caller-supplied base graph, dry run (no lock, no write), atomic, skipped-item reporting, lint, minted IDs, audit, and PUT /state.

Test plan

  • New unit tests: a concurrent change is refused; the same rows in a different order still commit. Both fail with the guard reverted.
  • apply-workflow-operations and replace-normalized-state tests pass locally
  • CI type-check, audits, full suite

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

greptile-apps[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@waleedlatif1
fix(workflows): serialize operation edits under the workflow row lock
697933c
@vercel

vercel Bot commented Nov 11, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Nov 11, 2026 9:57pm UTC

Request Review

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vercel
vercel Bot temporarily deployed to Preview November 11, 2026 21:42 Inactive
@greptile-apps

greptile-apps Bot commented Nov 11, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no blocking issues remain.

Summary

Workflow operation writes now check the stored graph under the row lock and refuse stale edits.

  • Workflow operation batches stop when the saved graph has changed.

Reviews (2) · Last reviewed commit: "fix(workflows): fingerprint only stored ..." · Reviewed by Greptile

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

greptile-apps[bot]
greptile-apps Bot reviewed Nov 11, 2026
View reviewed changes
Comment thread apps/sim/lib/workflows/application/apply-workflow-operations.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

cubic-dev-ai[bot]
cubic-dev-ai Bot reviewed Nov 11, 2026
View reviewed changes

@cubic-dev-ai cubic-dev-ai Bot left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>

Turn on auto-fix | Re-trigger cubic

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread apps/sim/lib/workflows/application/apply-workflow-operations.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@waleedlatif1
fix(workflows): fingerprint only stored rows so container child order…
9566068
… cannot raise a false conflict
@vercel
vercel Bot temporarily deployed to Preview November 11, 2026 21:57 Inactive
@waleedlatif1

waleedlatif1 commented Nov 11, 2026

Copy link
Copy Markdown
Collaborator Author

@greptile

greptile-apps[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@waleedlatif1

waleedlatif1 commented Nov 11, 2026

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

cubic-dev-ai[bot] reacted with eyes emoji
All reactions
  • 👀 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@cubic-dev-ai

cubic-dev-ai Bot commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

cubic-dev-ai[bot]
cubic-dev-ai Bot reviewed Nov 11, 2026
View reviewed changes

@cubic-dev-ai cubic-dev-ai Bot left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 4 files

Confidence score: 2/5

  • In apply-workflow-operations.ts, delegated edits with a supplied baseGraph can 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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread apps/sim/lib/workflows/application/apply-workflow-operations.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@waleedlatif1
waleedlatif1 merged commit 416a127 into staging Nov 11, 2026
80 checks passed

Uh oh!

There was an error while loading. Please reload this page.

This was referenced Nov 11, 2026
fix(api): release-audit follow-ups for the agent API work #9910
Merged
v0.9.54: non-OAuth auth for twelve more integrations, agent API additions (workflow outline, schedules list, paused runs, scoped CLI pairing keys), concurrent-edit guard, dependency updates #9912
Merged
@waleedlatif1
waleedlatif1 deleted the fix/workflow-ops-lock-base-read branch November 12, 2026 00:25

This branch was previously deployed

1 inactive deployment
Preview — 95660685 Deployed Nov 11, 2026 by vercel[bot]
View deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@greptile-apps greptile-apps[bot] greptile-apps[bot] left review comments
@cubic-dev-ai cubic-dev-ai[bot] cubic-dev-ai[bot] left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@waleedlatif1
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.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.