Skip to content

Commit 0bbb4d3

Browse files
committed
fix(table): validate no duplicate positions in batch_insert_rows
1 parent 1082cdb commit 0bbb4d3

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

apps/sim/lib/copilot/tools/server/table/user-table.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,12 @@ export const userTableServerTool: BaseServerTool<UserTableArgs, UserTableResult>
345345
message: `positions length (${positions.length}) must match rows length (${args.rows.length})`,
346346
}
347347
}
348+
if (positions !== undefined && new Set(positions).size !== positions.length) {
349+
return {
350+
success: false,
351+
message: 'positions must not contain duplicate values',
352+
}
353+
}
348354

349355
const table = await getTableById(args.tableId)
350356
if (!table) {

0 commit comments

Comments
 (0)