fix: detect policy plugin by stable id#2663
fix: detect policy plugin by stable id#2663Albatrosso wants to merge 1 commit intozenstackhq:devfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR fixes PolicyPlugin detection to use the stable ChangesPolicyPlugin Detection Stability Fix
Estimated Code Review Effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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 |
Summary
Fixes #2662
This updates ZenStack ORM policy plugin detection so it no longer relies on
constructor.name, which can be changed or removed by production bundling/minification.Policy mode is now detected through the stable runtime plugin id (
policy). This keeps ORM mutation behavior consistent whenPolicyPluginis active, including policy-safe delete behavior that avoidsDELETE ... RETURNING *followed by failed post-delete read-back.This problem can break deletes in Next.js/Turbopack production bundles with:
result is not allowed to be read backValidation
pnpm --filter @zenstackhq/orm build
TEST_DB_PROVIDER=sqlite pnpm --dir tests/regression exec vitest run test/policy-plugin-detection.test.ts
PostgreSQL validation was attempted but blocked by local default credential auth:
password authentication failed for user "postgres"Summary by CodeRabbit
Bug Fixes
Tests