fix: keep membership owners atomic - #1481
Conversation
|
Warning Review limit reached
Next review available in: 56 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (30)
✨ 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 |
a54f5e9 to
9a697ca
Compare
📊 Benchmark Results✅ All benchmarks passed
Updated: 2026-07-25T07:17:35.157Z · Commit: 9bfe554 |
b271cfc to
949f9f5
Compare
Outcome
Membership owner removal, demotion, and ownership transfer now use explicit atomic store contracts. Competing mutations serialize per tenant, preserve at least one owner, and map last-owner or serialization losers to stable membership Problems instead of allowing a validation/write race.
The in-memory and Drizzle adapters implement the contracts. Drizzle locks the current owner set and uses conditional DML, including a single ownership-transfer update. A digest-pinned PostgreSQL 16.10 service now runs the real READ COMMITTED, REPEATABLE READ, and SERIALIZABLE concurrency suite in the required CI validation job.
Custom
MembershipStoreadapters must implement the new atomic mutation and transfer methods; a minor changeset and generated API documentation record that compatibility requirement. The validation-onlyMembershipOwnerGuardis deprecated for write paths.Fixes #1463
Verification
@croco/membership-core— 77/77 tests@croco/membership-drizzle— 22/22 unit testsReview gates
Residual risk
Direct consumers of low-level
saveordeletecan still bypass owner invariants; write paths that enforce ownership must usemutateOwnerortransferOwnership. Custom persistent adapters must provide equivalent tenant-scoped serialization and normalize serialization failures toconflict.