Skip to content

test: cover large import batching boundaries - #138

Draft
cursor[bot] wants to merge 5 commits into
mainfrom
cursor/missing-test-coverage-7568
Draft

test: cover large import batching boundaries#138
cursor[bot] wants to merge 5 commits into
mainfrom
cursor/missing-test-coverage-7568

Conversation

@cursor

@cursor cursor Bot commented Aug 17, 2026

Copy link
Copy Markdown

Risky behavior now covered

  • A 201-session import is split into exact ordered batches of 100, 100, and 1 row.
  • Database upserts run sequentially rather than concurrently.
  • The endpoint waits for the final batch before returning and reports all 201 imported sessions.
  • Exact batch contents guard against boundary omissions, duplicates, and reordering.

Test files updated

  • test/web-import-route.test.ts

Why this reduces regression risk

The recent batching change prevents oversized database payloads and concurrent memory pressure on large local state imports. These assertions fail if batching is removed, batch boundaries drift, writes become concurrent, or the response returns before persistence finishes.

Validation

  • npm test — 133 root tests and 5 web tests passed
  • npm run build
  • npx prettier --check test/web-import-route.test.ts
  • Mutation check: replacing the sequential loop with Promise.all made the focused test fail because all three batches started concurrently.
Open in Web View Automation 

cursoragent and others added 5 commits August 17, 2026 10:02
Co-authored-by: Parvez Kose <koseparvez@gmail.com>
Co-authored-by: Parvez Kose <koseparvez@gmail.com>
Co-authored-by: Parvez Kose <koseparvez@gmail.com>
Co-authored-by: Parvez Kose <koseparvez@gmail.com>
Co-authored-by: Parvez Kose <koseparvez@gmail.com>
@vercel

vercel Bot commented Aug 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
polyagent Ready Ready Preview Aug 17, 2026 10:09am

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.

1 participant