fix(tables): stop row writes 500ing on a column outside the table schema - #6323
Conversation
createTableWriteProvenanceTargets (added in #6247) required every submitted column to translate to exactly one storage id and threw otherwise. The wire translator has always dropped keys naming no column in the schema, so any internal-JWT write carrying such a key threw an uncaught error and surfaced as a 500 — where the same write previously succeeded, since the write path drops the column identically. Give a dropped column a null column id instead of throwing. It still gets a target, so the bundle completeness check that pairs one selection per submitted column is unchanged, but no provenance is recorded for a value that is never stored.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryLow Risk Overview
Adds Reviewed by Cursor Bugbot for commit 7e2edf5. Configure here. |
Greptile SummaryThis PR prevents table row writes from failing when submitted data contains a column absent from the table schema.
Confidence Score: 5/5The PR appears safe to merge with no actionable defects identified. Production translators map each submitted key to either one storage column or no column, and the updated resolver preserves bundle completeness checks while omitting provenance only for values the write path drops.
|
| Filename | Overview |
|---|---|
| apps/sim/app/api/table/row-secret-provenance.ts | Safely distinguishes translator-dropped columns from persisted columns without weakening bundle validation on reachable production paths. |
| apps/sim/app/api/table/row-secret-provenance.test.ts | Adds focused coverage for translated, dropped, malformed, and scope-mismatched provenance cases. |
Reviews (1): Last reviewed commit: "fix(tables): stop row writes 500ing on a..." | Re-trigger Greptile
Summary
createTableWriteProvenanceTargets(added in feat(code): cli sandboxes, enterprise timeouts, secrets projections, resolver lift, workflow exec cancellations #6247) required every submitted column to translate to exactly one storage id and threw otherwisenullcolumn id instead of throwing. It still gets a target, so the bundle completeness check pairing one selection per submitted column is unchanged, but no provenance is recorded for a value that is never storedImpact
Live in production since v0.7.59. One customer table went from 2,284 consecutive 200s to 100% 500s at the rollout cutover; the same helper guards every table row write route (create, update, bulk, upsert), so any workflow sending a removed or misspelled column name was affected.
Type of Change
Testing
bunx vitest run app/api/table lib/table— 63 files, 931 tests passing. Verified the new tests fail with the original error when the fix is reverted, and that typecheck and lint are clean.Checklist