AI & Agent Dev Bug Sandbox logo
AI & Agent Dev Bug Sandbox
Back to Radar

Table Editor Non-Atomic Schema Mutations Cause Partial Application On Failure

Multiple schema changes in Table Editor actions are executed as independent awaited calls without a surrounding transaction, so if a later step fails, earlier changes remain committed, leaving the database in an inconsistent state. The issue also notes unawaited async operations in duplicateTable.

highConfidence 85%React

Origin Analysis

Functions like createColumn, updateColumn, updateTable, and duplicateTable perform multiple separate database mutations sequentially. Each mutation may commit its own transaction (due to pg-meta helper BEGIN/COMMIT), and there is no outer transaction to roll back all steps if one fails. Additionally, identityColumns.map(async ...) is not awaited, allowing async identity updates to continue after the function returns.
1. In Studio Table Editor, create a new column with primary key and foreign key constraints. 2. Introduce an error in the foreign key definition (e.g., reference a non-existent table). 3. Observe that the column is created but the UI reports an error, leaving the column without the intended constraints. Similar failures occur when updating a table or duplicating a table with identity columns.

Fixing Code Block

Edge Case Audit

This hotfix only addresses the unawaited async in duplicateTable. The main atomicity issue for createColumn, updateColumn, and updateTable remains. If you only apply this hotfix, schema changes can still be partially applied. Test thoroughly before relying on this; a full transaction refactor is recommended. Rollback this patch if it causes performance issues with many identity columns, as Promise.all may increase concurrency.

Ecosystem Topology

Agent Frameworks

LangChain, LlamaIndex, and Pydantic

  1. highProperty graph relation keys collide when entity IDs or labels contain underscores
  2. highCodeActAgent drops assistant tool-call metadata during handoff, leaving an orphan tool response
  3. high[Bug]: HierarchicalNodeParser async methods return the documents unsplit
  4. highLLM.predict_and_call fails with ValidationError for non-function-calling models when react_chat_formatter is omitted
  5. highAnthropic streaming server-tool input_json_delta overwrites completed client tool_use arguments due to stale cur_tool_call state