Skip to content

Fix native Convex pagination in infinite queries - #305

Merged
zbeyens merged 2 commits into
mainfrom
codex/fix-native-convex-pagination
Jul 23, 2026
Merged

Fix native Convex pagination in infinite queries#305
zbeyens merged 2 commits into
mainfrom
codex/fix-native-convex-pagination

Conversation

@zbeyens

@zbeyens zbeyens commented Jul 23, 2026

Copy link
Copy Markdown
Member
  • Auto release

🐛 Fixes discussion #304
🟢 95-100% confidence

Phase 🧪 Tests 🌐 Browser
Reproduced 🔴 React and Solid created a second subscription from a plain splitCursor ➖ N/A
Verified 🟢 focused 3-of-6 regression tests and bun check ➖ N/A

✅ Outcome

  • Native Convex pagination stays at three rows until fetchNextPage() is called.
  • hasNextPage is true before the second page and false after exhaustion.
  • Partial cRPC migration works without replacing native validators or pagination.

⚠️ Caveat

  • Fixture sync refreshed six generated lucide-react ranges.
  • Current Next required a client boundary in the raw shadcn runtime fixture.

🏗️ Design

  • Chosen layer: one internal Convex split predicate shared by React and Solid.
  • Why not hook-local patches: duplicated policy would drift between frameworks.
  • Why not an ORM migration: native Convex pagination already exposes the required contract.

🧪 Verified

  • React: 6 passing tests, 29 assertions.
  • Solid: 5 passing tests.
  • bun --cwd packages/kitcn typecheck
  • bun --cwd packages/kitcn build
  • bun run fixtures:check
  • bun run scenario:test -- create-convex-nextjs-shadcn
  • bun check

@vercel

vercel Bot commented Jul 23, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
better-convex Ready Ready Preview, Comment Jul 23, 2026 6:36pm

Request Review

@changeset-bot

changeset-bot Bot commented Jul 23, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 78f6f4e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
kitcn Patch
@kitcn/resend Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0e6caccdde

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Boolean(page.splitCursor) &&
(page.pageStatus === 'SplitRecommended' ||
page.pageStatus === 'SplitRequired' ||
(initialNumItems !== undefined && page.page.length > initialNumItems * 2));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve default page size for reactive splits

When callers rely on the .paginated({ limit }) server default and call infiniteQueryOptions(args) without an override, initialNumItems is undefined here, so the new size-based split branch is disabled for plain-splitCursor pages. In that common/default-limit path, a live page can grow past twice its intended page size without being split, leaving an ever-growing first subscription; carry the generated/default page size into this predicate instead of only using the optional client override.

Useful? React with 👍 / 👎.

@zbeyens
zbeyens merged commit b7ccc0b into main Jul 23, 2026
5 checks passed
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