-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: avoid race condition when creating policies
If you're trying to startup multiple Yates clients simultaneously, it's possible that you hit an error where on client tries to create a policy that the other client has already created. This occurs because we read *all* abilities in one go. To avoid this, we check the ability table once per RLS policy, and we do it inside a transaction with a lock. This means that the second client will behave correctly and not try to create the policy again.
- Loading branch information
1 parent
3cd9dc7
commit b7b3b78
Showing
1 changed file
with
41 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters