Skip to content

fix(tables): stop row writes 500ing on a column outside the table schema - #6323

Merged
waleedlatif1 merged 1 commit into
stagingfrom
fix/table-row-provenance-unknown-column
Aug 6, 2026
Merged

fix(tables): stop row writes 500ing on a column outside the table schema#6323
waleedlatif1 merged 1 commit into
stagingfrom
fix/table-row-provenance-unknown-column

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

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 otherwise
  • The wire translator has always dropped keys naming no column in the schema, so an internal-JWT write carrying such a key threw an uncaught error and returned a 500 — the same write previously succeeded, since the write path drops the column identically
  • A dropped column now gets a null column 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 stored
  • Added regression tests for the dropped-column paths and the existing bundle rejection guards

Impact

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

  • Bug fix

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

  • 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)

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

vercel Bot commented Aug 6, 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 6, 2026 9:08am

Request Review

@cursor

cursor Bot commented Aug 6, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Localized bug fix in table row provenance helpers; behavior matches existing write dropping and only avoids throwing; regression tests added.

Overview
Fixes 500s on table row writes when the payload includes column keys that are not in the table schema (removed names, typos, etc.). The write path already drops those keys like the wire translator; provenance setup used to throw if translation did not yield exactly one storage id.

createTableWriteProvenanceTargets now assigns columnId: null for dropped keys instead of throwing, while still emitting one target per submitted column so internal-JWT bundle completeness checks stay aligned. resolveTableWriteSecretProvenance skips recording provenance for null column ids on session and bundle paths, and only treats duplicate storage ids as invalid when provenance is actually stored.

Adds row-secret-provenance.test.ts covering dropped columns, bundle acceptance, and existing rejection guards.

Reviewed by Cursor Bugbot for commit 7e2edf5. Configure here.

@greptile-apps

greptile-apps Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR prevents table row writes from failing when submitted data contains a column absent from the table schema.

  • Represents translator-dropped columns with a null storage ID while retaining their provenance-selection targets for completeness validation.
  • Skips provenance persistence for values the row write path does not store.
  • Adds regression coverage for dropped columns, valid provenance bundles, scope rejection, and unmatched selections.

Confidence Score: 5/5

The 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.

Important Files Changed

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

@waleedlatif1
waleedlatif1 merged commit 4340e2e into staging Aug 6, 2026
30 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/table-row-provenance-unknown-column branch August 6, 2026 09:14
Sign up for free to 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