Skip to content

feat: add owner-gated community hard delete#1746

Open
kalvinnchau wants to merge 1 commit into
mainfrom
kalvin/community-hard-delete
Open

feat: add owner-gated community hard delete#1746
kalvinnchau wants to merge 1 commit into
mainfrom
kalvin/community-hard-delete

Conversation

@kalvinnchau

@kalvinnchau kalvinnchau commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add DELETE /operator/communities/{host}?owner_pubkey=... with operator-signed NIP-98 authentication and owner attestation
  • lock the current owner row and community before permanently deleting the tenant
  • migrate all 22 parent-table community foreign keys to ON DELETE CASCADE; PostgreSQL propagates the policy to 14 partition constraint clones
  • preserve the full hostname uniqueness index so deleted hosts are immediately reusable without mixed-version or rollback hazards
  • bring the checked-in final-state schema.sql snapshot in sync with migration 0002 by including the previously omitted git_repo_names table; this is snapshot correction, not new runtime DDL

Safety

  • non-matching owners receive a non-enumerating 404 and cannot delete
  • migration integration test asserts every direct community FK, including partition clones, has CASCADE behavior
  • hard-delete integration test verifies child rows are removed and recreation receives a fresh community UUID

Testing

  • cargo fmt --all -- --check
  • cargo clippy -p buzz-db -p buzz-relay --all-targets -- -D warnings
  • focused migration embedding + real-Postgres fresh migration test
  • real-Postgres hard-delete cascade/owner test
  • real-Postgres operator API delete test
  • pre-commit hooks
  • pre-push hooks (Rust, desktop, Tauri, and mobile suites)

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 10, 2026 23:54
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.

1 participant