fix(tables): handle row deletion during cell execution - #6520
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview A new 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. |
Greptile SummaryThe PR safely handles rows deleted while workflow or enrichment cells are executing.
Confidence Score: 5/5The 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.
|
| 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
Reviews (1): Last reviewed commit: "fix(tables): handle row deletion during ..." | Re-trigger Greptile
Summary
Type of Change
Testing
Checklist