Skip to content
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

chore: Add info on known limitations wrt nested transactions #69

Merged
merged 1 commit into from
Oct 11, 2023

Conversation

LucianBuzzo
Copy link
Contributor

@LucianBuzzo LucianBuzzo commented Oct 11, 2023

Yates uses a transaction to apply the RLS policies to each query. This means that if you are using transactions in your application, rollbacks will not work as expected. This is because Prisma has poor support for nested transactions and will COMMIT the inner transaction even if the outer transaction is rolled back.
If you need this functionality and you are using Yates, you can return null from the getContext() setup method to bypass the internal transaction, and therefore the RLS policies for the current request. see the nested-transactions.spec.ts test case for an example of how to do this.

@github-actions
Copy link
Contributor

Published beta package version: 3.0.0-beta.dangerous.7afa59e

@LucianBuzzo LucianBuzzo force-pushed the lucianbuzzo/nest-transactions-limitation branch from 5a01259 to 616f508 Compare October 11, 2023 12:54
@sonarcloud
Copy link

sonarcloud bot commented Oct 11, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
38.4% 38.4% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

@LucianBuzzo LucianBuzzo merged commit fcc8fcf into master Oct 11, 2023
5 of 6 checks passed
@LucianBuzzo LucianBuzzo deleted the lucianbuzzo/nest-transactions-limitation branch October 11, 2023 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants