Fix native Convex pagination in infinite queries - #305
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 78f6f4e The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
There was a problem hiding this comment.
💡 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)); |
There was a problem hiding this comment.
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 👍 / 👎.
🐛 Fixes discussion #304
🟢 95-100% confidence
splitCursorbun check✅ Outcome
fetchNextPage()is called.hasNextPageis true before the second page and false after exhaustion.lucide-reactranges.🏗️ Design
🧪 Verified
bun --cwd packages/kitcn typecheckbun --cwd packages/kitcn buildbun run fixtures:checkbun run scenario:test -- create-convex-nextjs-shadcnbun check