-
-
Notifications
You must be signed in to change notification settings - Fork 12
fix: more issues found with formbricks #79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
ymc9
commented
Jul 8, 2025
- Nested transaction handling
- Fixed issue with concurrent transactions
- Temporarily disabled running Kysely query interceptor in a transaction
- Nested transaction handling - Fixed issue with concurrent transactions - Temporarily disabled running Kysely query interceptor in a transaction
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR addresses several issues around transaction handling, concurrent transactions, and temporarily disables Kysely query interceptors within transactions.
- Regenerated schema file formatting (quote style changes, inlining attributes, disabled eslint for generated code)
- Updated and extended test suites: added transaction coverage, cleaned up client specs, and disabled flaky transactional tests
- Refactored transaction support in policy handlers and query executor, introduced debug flag, and enhanced error messages
Reviewed Changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/runtime/test/typing/schema.ts | Re-formatted generated schema with double quotes & disabled eslint |
| packages/runtime/test/plugin/mutation-hooks.test.ts | Added afterEach teardown; commented out unstable transaction tests |
| packages/runtime/test/client-api/transaction.test.ts | New tests for nested and simple transactions |
| packages/runtime/src/plugins/policy/policy-handler.ts | Removed transaction parameter from handler, added TODOs |
| packages/runtime/src/plugins/policy/plugin.ts | Updated onKyselyQuery to drop transaction support |
| packages/runtime/src/client/executor/zenstack-query-executor.ts | Disabled transactional wrapping for interceptors and adjusted error logging |
Comments suppressed due to low confidence (3)
packages/runtime/src/plugins/policy/policy-handler.ts:57
- The
transactionparameter was commented out inhandle, preventing policy enforcement from running inside a transaction. Consider restoring thetransactionargument and wrapping the pre- and post-processing logic in a transaction to ensure atomic policy checks.
async handle(
packages/runtime/src/plugins/policy/plugin.ts:18
- Dropping the
transactionargument here meansPolicyHandler.handlewon't receive a valid transaction callback. You should re-enable passing thetransactionparameter to keep policy checks within transactions.
onKyselyQuery({ query, client, proceed /*, transaction*/ }: OnKyselyQueryArgs<Schema>) {
packages/runtime/src/client/executor/zenstack-query-executor.ts:101
- Replacing the transactional wrapper (
executeWithTransaction) with a directtask()call disables transaction support for mutation interceptors. To restore expected behavior, reintroduceexecuteWithTransaction(task, !!mutationInterceptionInfo?.useTransactionForMutation).
return task();