Skip to content

Chunk rows to max allowed size in table batch delete endpoint#2380

Merged
MarceloRGonc merged 1 commit into
mainfrom
ops-4566-oss
Jun 25, 2026
Merged

Chunk rows to max allowed size in table batch delete endpoint#2380
MarceloRGonc merged 1 commit into
mainfrom
ops-4566-oss

Conversation

@ravikiranvm

@ravikiranvm ravikiranvm commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Fixes OPS-4566

Additional Notes

Problem

Baserow enforces a batch size limit of 200 on the batch-delete endpoint (items list max_length=200). When a campaign runs with a savings threshold enabled and more than 200 opportunities fall below it, batchDeleteRows sent all row IDs in a single request, which Baserow rejected with 400 ERROR_REQUEST_BODY_VALIDATION ("no more than 200 elements").

The error propagated up uncaught and aborted handleDiscoveryCompletion before it reset needsDiscoveryRefresh, so the rows were never pruned and the campaign got stuck asking the user to refresh. Hit in the Informa env on the "AWS - Rightsize EBS Volumes" campaign (the first to exceed 200 sub-threshold rows).

Fix

Chunk the row IDs into batches of at most 200 when calling the batch-delete endpoint, mirroring the existing chunking in batchCreateRows/batchUpdateRows.

@linear

linear Bot commented Jun 25, 2026

Copy link
Copy Markdown

OPS-4566

@ravikiranvm ravikiranvm marked this pull request as ready for review June 25, 2026 11:31
Copilot AI review requested due to automatic review settings June 25, 2026 11:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes OpenOps Tables batch row deletion against Baserow by chunking rowIds into batches of 200 (Baserow’s documented max length), preventing 400 validation errors when deleting more than 200 rows in one call.

Changes:

  • Update batchDeleteRows to send multiple batch-delete requests, each with up to MAX_BATCH_ROWS (200) row IDs.
  • Add a unit test ensuring 450 IDs are split into 3 requests (200/200/50), mirroring existing create/update chunking behavior.

Blocking

None

Non-blocking

None

Merge recommendation

Ready to merge

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
packages/openops/src/lib/openops-tables/rows.ts Chunk batchDeleteRows requests to respect Baserow’s 200-item limit.
packages/openops/test/openops-tables/rows.test.ts Add coverage verifying delete chunking behavior across multiple requests.

@ravikiranvm ravikiranvm requested a review from MarceloRGonc June 25, 2026 11:41
@MarceloRGonc MarceloRGonc merged commit 2fce598 into main Jun 25, 2026
22 checks passed
@MarceloRGonc MarceloRGonc deleted the ops-4566-oss branch June 25, 2026 12:08
@sonarqubecloud

Copy link
Copy Markdown

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.

3 participants