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(tables): handle row deletion during cell execution by TheodoreSpeaks · Pull Request #6520 · simstudioai/sim

Conversation

@TheodoreSpeaks

@TheodoreSpeaks TheodoreSpeaks commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Summary

  • skip workflow and enrichment cell writes when the target row has been deleted
  • prevent execution-status foreign-key races while preserving fail-fast behavior for unexpected errors

Type of Change

  • Bug fix

Testing

  • 40 targeted tests passed
  • TypeScript type-check passed
  • lint, block-registry validation, and all 22 repository audits passed

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

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
@TheodoreSpeaks
fix(tables): handle row deletion during cell execution
7e728d0
@vercel

vercel Bot commented Aug 11, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Aug 11, 2026 1:33am

Request Review

All reactions

Sorry, something went wrong.

Uh oh!

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

@cursor

cursor Bot commented Aug 11, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown

PR Summary

Medium Risk
Changes the hot path for workflow cell persistence during execution; scope is limited to treating deleted rows as skips and typed errors, with tests covering skip vs throw behavior.

Overview
Workflow and enrichment cell writes now gracefully skip when the target row was deleted instead of failing or racing execution-status foreign keys.

A new TableRowNotFoundError replaces generic “row not found” throws from updateRow (and related row mutations). writeWorkflowGroupState catches that error on data patches and returns skipped without SSE events. Status-only execution updates first lock and verify the row (SELECT … FOR KEY SHARE) before writeExecutionsPatch; a missing row also yields skipped.

Unexpected write failures (e.g. database errors) still propagate; only missing-row cases are treated as benign.

Reviewed by Cursor Bugbot for commit 7e728d0. Bugbot is set up for automated code reviews on this repo. Configure here.

All reactions

Sorry, something went wrong.

Uh oh!

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

@greptile-apps

greptile-apps Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR safely handles rows deleted while workflow or enrichment cells are executing.

  • Adds a typed missing-row error for row updates and skips only that expected failure in cell writes.
  • Locks the parent row during status-only execution writes so deletion and foreign-key cascades cannot race execution-state updates.
  • Adds targeted coverage for deletion before pickup, deletion during a data write, and propagation of unrelated failures.

Confidence Score: 5/5

The PR appears safe to merge; the deletion race is handled without suppressing unrelated write failures.

The parent-row lock closes the execution-status foreign-key race, while the typed error catch narrowly handles rows disappearing from data-write paths and preserves unexpected exceptions.

Important Files Changed

Filename Overview
apps/sim/lib/table/cell-write.ts Serializes status-only writes with row deletion and converts only typed deletion races into skipped writes.
apps/sim/lib/table/rows/service.ts Replaces generic missing-row exceptions at both update race points with the dedicated error type.
apps/sim/lib/table/rows/errors.ts Defines a focused error class used to distinguish expected row-deletion races.
apps/sim/lib/table/cell-write.test.ts Covers deletion before pickup, deletion during mutation, locking, and fail-fast handling of unrelated errors.

Sequence Diagram

sequenceDiagram
  participant Writer as Cell execution writer
  participant Rows as userTableRows
  participant Exec as tableRowExecutions
  participant Delete as Concurrent row deletion

  alt Data patch
    Writer->>Rows: updateRow(...)
    Rows-->>Writer: TableRowNotFoundError if deleted
    Writer-->>Writer: Return skipped
  else Status-only patch
    Writer->>Rows: SELECT ... FOR KEY SHARE
    alt Row exists
      Writer->>Exec: writeExecutionsPatch(...)
      Exec-->>Writer: Result
      Writer->>Rows: Commit and release lock
      Delete->>Rows: Delete row after lock release
    else Row missing
      Rows-->>Writer: No row
      Writer-->>Writer: Return skipped
    end
  end
Loading

Reviews (1): Last reviewed commit: "fix(tables): handle row deletion during ..." | Re-trigger Greptile

All reactions

Sorry, something went wrong.

Uh oh!

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

@TheodoreSpeaks
TheodoreSpeaks merged commit f5c06d4 into staging Aug 11, 2026
30 checks passed

Uh oh!

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

@TheodoreSpeaks
TheodoreSpeaks deleted the fix/enrichment-row-delete branch August 11, 2026 01:39
This was referenced Aug 11, 2026
v0.8.0: new workflow UI, v2 API, salesforce JWT, provenance improvements, incidentio tools, block retries #6533
Closed
v0.8.0: desktop app, workflow UI, v2 endpoints #6606
Merged

This branch was previously deployed

1 inactive deployment
Preview — 7e728d0e Deployed Aug 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

No reviews

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

@TheodoreSpeaks
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.