Skip to content

Fix pagination metadata and bulk operations in server tests#184

Merged
hotlong merged 3 commits intocopilot/release-new-versionfrom
copilot/update-documentation-links
Jan 24, 2026
Merged

Fix pagination metadata and bulk operations in server tests#184
hotlong merged 3 commits intocopilot/release-new-versionfrom
copilot/update-documentation-links

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 24, 2026

Four server tests were failing due to incorrect pagination count calculation and MockDriver-QueryAST format mismatches.

Changes

packages/runtime/server/src/server.ts

  • Extract only filters and expand before calling count() to exclude pagination parameters from total count calculation

packages/runtime/server/test/rest.test.ts

  • Support QueryAST top field (previously only checked limit)
  • Handle FilterNode array format [['field', 'op', 'value']] from FilterTranslator
  • Exclude pagination from count queries

packages/runtime/server/test/rest-advanced.test.ts

  • Support QueryAST top field
  • Exclude pagination from count queries

Context

The QueryBuilder converts { limit: 10, filters: { role: 'user' } } into QueryAST with { top: 10, filters: [['role', '=', 'user']] }. MockDrivers were expecting the unconverted format, causing:

  • Pagination to be ignored (checking wrong field)
  • Filters to fail (wrong format)
  • Total counts to be limited (pagination applied to count)
// Before: count included pagination
const total = await repo.count(args); // args = { limit: 10, filters: {...} }

// After: count excludes pagination
const countArgs: any = {};
if (args.filters) countArgs.filters = args.filters;
const total = await repo.count(countArgs);

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • fonts.googleapis.com
    • Triggering command: /usr/local/bin/node node /home/REDACTED/work/objectql/objectql/apps/site/node_modules/.bin/../next/dist/bin/next build (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

引用: https://github.com/objectstack-ai/objectql/actions/runs/21311189343/job/61347674187#step:10:1


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@vercel
Copy link
Copy Markdown

vercel Bot commented Jan 24, 2026

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

Project Deployment Review Updated (UTC)
objectql-site Ready Ready Preview, Comment Jan 24, 2026 7:37am

Request Review

@github-actions
Copy link
Copy Markdown
Contributor

⚠️ No Changeset Found

This PR does not include a changeset file.
If this PR includes user-facing changes, please add a changeset by running:

pnpm changeset

@hotlong hotlong marked this pull request as ready for review January 24, 2026 07:30
Copilot AI review requested due to automatic review settings January 24, 2026 07:30
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request.

Copilot AI and others added 2 commits January 24, 2026 07:33
- Fixed pagination metadata calculation to exclude limit/skip from count
- Fixed MockDriver to support QueryAST 'top' field instead of 'limit'
- Fixed MockDriver to handle FilterNode array format from QueryAST
- Fixed count method to exclude skip/limit parameters
- All 129 tests now passing

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
- Added JSDoc comments to matchesFilter and evaluateCondition methods
- Fixed 'in' operator to return false when value is not an array
- All tests still passing

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Copilot AI changed the title [WIP] Update documentation links in project Fix pagination metadata and bulk operations in server tests Jan 24, 2026
Copilot AI requested a review from hotlong January 24, 2026 07:37
@github-actions
Copy link
Copy Markdown
Contributor

⚠️ No Changeset Found

This PR does not include a changeset file.
If this PR includes user-facing changes, please add a changeset by running:

pnpm changeset

@hotlong hotlong merged commit 8ee68a7 into copilot/release-new-version Jan 24, 2026
2 checks passed
@hotlong hotlong deleted the copilot/update-documentation-links branch January 24, 2026 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants