Skip to content

fix(tables): tolerate row deletion during run cancellation - #6600

Merged
TheodoreSpeaks merged 2 commits into
stagingfrom
fix/table-row-delete
Aug 12, 2026
Merged

fix(tables): tolerate row deletion during run cancellation#6600
TheodoreSpeaks merged 2 commits into
stagingfrom
fix/table-row-delete

Conversation

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator

Summary

  • ignore rows deleted during cancellation writes and tombstone insertion
  • preserve fail-fast behavior for unrelated database failures
  • add regression coverage for both deletion races

Type of Change

  • Bug fix

Testing

  • bun run test lib/table/workflow-columns.test.ts
  • bun run type-check
  • bunx biome lint apps/sim/lib/table/workflow-columns.ts apps/sim/lib/table/workflow-columns.test.ts
  • bun run check:api-validation

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)

@vercel

vercelBot commented Aug 12, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
ProjectDeploymentActionsUpdated (UTC)
docsSkippedSkippedAug 12, 2026 4:45am

Request Review

@cursor

cursorBot commented Aug 12, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Touches cancellation write/error handling for in-flight table runs; incorrect swallowing could hide real DB failures, though the change is narrowly scoped and covered by tests.

Overview
Makes cancelWorkflowGroupRuns resilient when a row is deleted mid-cancellation.

Cancellation writes now swallow TableRowNotFoundError (including transaction-wrapped causes) so a deleted row no longer fails the whole cancel pass. Unrelated write errors still fail fast.

Tombstone inserts similarly ignore Postgres FK violations on the row FK (table_row_executions_row_id_user_table_rows_id_fk) when the row is already gone, while still rethrowing other constraint failures.

Adds regression coverage for both deletion races.

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

@greptile-apps

greptile-appsBot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR makes workflow-group cancellation tolerate rows deleted concurrently while preserving fail-fast behavior for unrelated database errors.

  • Finds TableRowNotFoundError anywhere in the cancellation write’s wrapped cause chain.
  • Ignores only the expected row foreign-key violation during tombstone insertion.
  • Adds regression tests for both deletion races and unrelated-error propagation.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

FilenameOverview
apps/sim/lib/table/workflow-columns.tsAdds narrowly scoped handling for wrapped row-not-found errors and row-FK tombstone failures without suppressing unrelated write errors.
apps/sim/lib/table/workflow-columns.test.tsAdds focused coverage for direct and transaction-wrapped deletion races plus fail-fast behavior for unrelated failures.

Reviews (2): Last reviewed commit: "fix(tables): unwrap row deletion errors" | Re-trigger Greptile

Comment threadapps/sim/lib/table/workflow-columns.ts Outdated
@TheodoreSpeaks

Copy link
Copy Markdown
CollaboratorAuthor

@greptile

@TheodoreSpeaks

Copy link
Copy Markdown
CollaboratorAuthor

@cursor review

@cursorcursorBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit f008e38. Configure here.

@TheodoreSpeaks
TheodoreSpeaks merged commit 0877ecb into stagingAug 12, 2026
30 checks passed
@TheodoreSpeaks
TheodoreSpeaks deleted the fix/table-row-delete branch August 12, 2026 04:51
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@TheodoreSpeaks