Skip to content

Commit 659e02e

Browse files
waleedlatif1claude
andcommitted
fix(tables): log error on cell data restoration failure during undo
Add onError handler to the batchUpdateRowsMutation inside delete-column undo so failures are logged instead of silently swallowed. The column schema restores first, and the cell data restoration is a separate async call that the outer try/catch cannot intercept. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent ecbb5c8 commit 659e02e

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

apps/sim/hooks/use-table-undo.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,17 @@ export function useTableUndo({
230230
rowId: c.rowId,
231231
data: { [action.columnName]: c.value },
232232
}))
233-
batchUpdateRowsMutation.mutate({ updates })
233+
batchUpdateRowsMutation.mutate(
234+
{ updates },
235+
{
236+
onError: (error) => {
237+
logger.error('Failed to restore cell data on delete-column undo', {
238+
columnName: action.columnName,
239+
error,
240+
})
241+
},
242+
}
243+
)
234244
}
235245
const metadata: Record<string, unknown> = {}
236246
if (action.previousOrder) {

0 commit comments

Comments
 (0)