Skip to content

feat(relay): add atomic create-only community provisioning#1689

Merged
kalvinnchau merged 3 commits into
mainfrom
kalvin/operator-create-only
Jul 10, 2026
Merged

feat(relay): add atomic create-only community provisioning#1689
kalvinnchau merged 3 commits into
mainfrom
kalvin/operator-create-only

Conversation

@kalvinnchau

Copy link
Copy Markdown
Contributor

Summary

  • add an explicit create_only operator provisioning mode
  • atomically insert the community and initial owner in one transaction
  • return 409 Conflict when the host already exists instead of rotating ownership
  • preserve the existing convergence mode for deployment-root tooling

Why

Kgoose provisions communities for end users. The existing ensure-and-rotate behavior allows an availability/create race to rotate an existing community owner. This closes that race at the database boundary.

Testing

  • cargo fmt --all
  • cargo check -p buzz-db -p buzz-relay
  • cargo test -p buzz-db create_community_with_owner_is_atomic_and_create_only -- --ignored --nocapture
  • cargo test -p buzz-relay operator --no-fail-fast
  • pre-push Rust and desktop-Tauri suites passed; JS/mobile hooks could not run because pnpm, dart, and flutter are unavailable locally

Co-authored-by: npub1dccv64krpcpse5cmkzfeh998cftungyatw3djt8jwdw6g43f7fyqzzmrf7 <6e30cd56c30e030cd31bb0939b94a7c257c9a09d5ba2d92cf2735da45629f248@sprout-oss.stage.blox.sqprod.co>
Signed-off-by: npub1dccv64krpcpse5cmkzfeh998cftungyatw3djt8jwdw6g43f7fyqzzmrf7 <6e30cd56c30e030cd31bb0939b94a7c257c9a09d5ba2d92cf2735da45629f248@sprout-oss.stage.blox.sqprod.co>
@kalvinnchau kalvinnchau requested a review from a team as a code owner July 9, 2026 20:00
Co-authored-by: npub1dccv64krpcpse5cmkzfeh998cftungyatw3djt8jwdw6g43f7fyqzzmrf7 <6e30cd56c30e030cd31bb0939b94a7c257c9a09d5ba2d92cf2735da45629f248@sprout-oss.stage.blox.sqprod.co>
Signed-off-by: npub1dccv64krpcpse5cmkzfeh998cftungyatw3djt8jwdw6g43f7fyqzzmrf7 <6e30cd56c30e030cd31bb0939b94a7c257c9a09d5ba2d92cf2735da45629f248@sprout-oss.stage.blox.sqprod.co>

@baxen baxen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Co-authored-by: npub16ynjrn8tm9gxg4kpgfgj24eup8met48z58m9g0cvmpq9msjht0lq7r96r6 <d12721ccebd9506456c1425125573c09f795d4e2a1f6543f0cd8405dc2575bfe@sprout-oss.stage.blox.sqprod.co>
Signed-off-by: npub16ynjrn8tm9gxg4kpgfgj24eup8met48z58m9g0cvmpq9msjht0lq7r96r6 <d12721ccebd9506456c1425125573c09f795d4e2a1f6543f0cd8405dc2575bfe@sprout-oss.stage.blox.sqprod.co>

@baxen baxen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved after end-to-end review with squareup/cash-server#104238. Atomic create-only provisioning, natural same-owner retry behavior, management-origin NIP-98 binding, and conflict semantics look correct.

@kalvinnchau kalvinnchau merged commit 1de916b into main Jul 10, 2026
27 of 29 checks passed
@kalvinnchau kalvinnchau deleted the kalvin/operator-create-only branch July 10, 2026 03:16
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