Skip to content

Commit ce6d431

Browse files
fix(tables): thread running row count through copilot batchInsertAll capacity check
1 parent 498bd20 commit ce6d431

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,9 @@ async function batchInsertAll(
174174
const requestId = generateId().slice(0, 8)
175175
const result = await batchInsertRows(
176176
{ tableId, rows: batch, workspaceId, userId },
177-
table,
177+
// Pass the running total so each batch's capacity check sees cumulative rows,
178+
// not the same pre-loop snapshot (which would let a multi-batch insert overshoot).
179+
{ ...table, rowCount: table.rowCount + inserted },
178180
requestId
179181
)
180182
inserted += result.length

0 commit comments

Comments
 (0)