Skip to content

fix: handle parameterised values in the cursor#29184

Merged
jacek-prisma merged 2 commits intomainfrom
fix/fix-29176
Feb 13, 2026
Merged

fix: handle parameterised values in the cursor#29184
jacek-prisma merged 2 commits intomainfrom
fix/fix-29176

Conversation

@jacek-prisma
Copy link
Copy Markdown
Contributor

@jacek-prisma jacek-prisma commented Feb 13, 2026

TML-1902
Fixes #29176

Summary by CodeRabbit

  • Bug Fixes

    • Fixed cursor-based pagination to correctly evaluate dynamic cursor and nested processing parameters during in-memory query processing.
  • Tests

    • Added functional tests validating composite cursor pagination and related behavior.
  • Chores

    • Tightened the pagination cursor type for stronger type-safety in client runtime.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Feb 13, 2026

Walkthrough

Added evaluation of in-memory processing parameters in the query interpreter and changed Pagination.cursor type to Record<string, unknown> | null. Added functional tests (matrix, Prisma schema, and test) validating composite cursor pagination for SQLite adapters.

Changes

Cohort / File(s) Summary
Runtime query interpreter & types
packages/client-engine-runtime/src/interpreter/query-interpreter.ts, packages/client-engine-runtime/src/query-plan.ts
Imported InMemoryOps and added runtime evaluation of processing parameters for process nodes (calls evaluateProcessingParameters for node.args.operations). Changed Pagination.cursor type from `Record<string, PrismaValue>
Functional tests for composite cursor pagination
packages/client/tests/functional/issues/29176-cursor-parameter-regression/_matrix.ts, packages/client/tests/functional/issues/29176-cursor-parameter-regression/prisma/_schema.ts, packages/client/tests/functional/issues/29176-cursor-parameter-regression/tests.ts
Added test matrix, provider-aware Prisma schema defining ListResult with composite unique index, and a test that inserts rows and asserts correct results for composite cursor findMany (validates cursor-based pagination behavior).
🚥 Pre-merge checks | ✅ 5 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: handle parameterised values in the cursor' directly describes the main fix addressing cursor parameter handling.
Linked Issues check ✅ Passed The PR addresses issue #29176 by implementing cursor parameter evaluation, adding regression test with composite cursor pagination, and restoring correct semantics.
Out of Scope Changes check ✅ Passed All changes are directly scoped to fixing cursor parameter handling: query interpreter logic, type corrections, and regression tests for composite cursors.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/fix-29176

No actionable comments were generated in the recent review. 🎉


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 13, 2026

Client memory tests, node 22.12.0, client:
❌ Failure, see report.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 13, 2026

Client memory tests, node 24, client:
✅ Success

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 13, 2026

size-limit report 📦

Path Size
packages/client/runtime/index-browser.js 2.23 KB (0%)
packages/client/runtime/index-browser.d.ts 3.28 KB (0%)
packages/cli/build/index.js 2.53 MB (0%)
packages/client/prisma-client-0.0.0.tgz 26.77 MB (+0.01% 🔺)
packages/cli/prisma-0.0.0.tgz 12.75 MB (0%)
packages/bundle-size/da-workers-libsql/output.tgz 1.32 MB (+0.01% 🔺)
packages/bundle-size/da-workers-neon/output.tgz 1.39 MB (+0.01% 🔺)
packages/bundle-size/da-workers-pg/output.tgz 1.38 MB (+0.01% 🔺)
packages/bundle-size/da-workers-planetscale/output.tgz 1.33 MB (+0.01% 🔺)
packages/bundle-size/da-workers-d1/output.tgz 1.3 MB (+0.01% 🔺)

@aqrln aqrln added this to the 7.4.1 milestone Feb 13, 2026
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Feb 13, 2026
@jacek-prisma jacek-prisma merged commit 1701fe6 into main Feb 13, 2026
255 of 256 checks passed
@jacek-prisma jacek-prisma deleted the fix/fix-29176 branch February 13, 2026 13:23
SupertigerDev added a commit to Nerimity/nerimity-server that referenced this pull request Feb 15, 2026
jacek-prisma added a commit that referenced this pull request Feb 19, 2026
[TML-1902](https://linear.app/prisma-company/issue/TML-1902/investigate-and-fix-cursor-pagination-regression-in-74)
Fixes #29176

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Bug Fixes**
* Fixed cursor-based pagination to correctly evaluate dynamic cursor and
nested processing parameters during in-memory query processing.

* **Tests**
* Added functional tests validating composite cursor pagination and
related behavior.

* **Chores**
* Tightened the pagination cursor type for stronger type-safety in
client runtime.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cursor-based pagination always returns 0 results starting in 7.4.0

2 participants