fix: fix accidental query plan mutation#29262
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro 📒 Files selected for processing (3)
WalkthroughApplied recursive DeepReadonly/DeepUnreadonly types across client-engine-runtime, tightened multiple public/internal function signatures to accept readonly inputs, added cloneObject(), adjusted array mutability for params/fields, and added a functional test suite reproducing query-plan cache mutation (cursor pagination) behavior. Changes
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
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. Comment |
a0d8e5a to
c808dd5
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (10)
packages/client-engine-runtime/src/events.tspackages/client-engine-runtime/src/interpreter/in-memory-processing.tspackages/client-engine-runtime/src/interpreter/query-interpreter.tspackages/client-engine-runtime/src/interpreter/render-query.tspackages/client-engine-runtime/src/interpreter/validation.tspackages/client-engine-runtime/src/tracing.tspackages/client-engine-runtime/src/utils.tspackages/client/tests/functional/issues/29254-query-plan-cache-mutation/_matrix.tspackages/client/tests/functional/issues/29254-query-plan-cache-mutation/prisma/_schema.tspackages/client/tests/functional/issues/29254-query-plan-cache-mutation/tests.ts
packages/client/tests/functional/issues/29254-query-plan-cache-mutation/tests.ts
Outdated
Show resolved
Hide resolved
size-limit report 📦
|
[TML-1946](https://linear.app/prisma-company/issue/TML-1946/investigate-and-fix-null-cursor-regression) Fixes a bug where the query interpreter would unintentionally mutate the query plan. I've marked all of the query plan bits as readonly in the query interpreter to prevent similar issues. Fixes #29254 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Tests** * Added functional tests, a test matrix and a dynamic schema to cover query-plan cache mutation and paging scenarios. * **Refactor** * Enforced immutability across the query runtime and rendering pipeline by using DeepReadonly/DeepUnreadonly and safer cloning where needed. * Introduced deep readonly/unreadonly type utilities. * **Bug Fixes** * Made parameter and field collections readonly in public signatures to prevent accidental mutations. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
TML-1946
Fixes a bug where the query interpreter would unintentionally mutate the query plan. I've marked all of the query plan bits as readonly in the query interpreter to prevent similar issues.
Fixes #29254
Summary by CodeRabbit
Tests
Refactor
Bug Fixes