Repository navigation
Conversation
Signed-off-by: Ravneet Arora <rarora@squareup.com>
Rebase & Conflict Resolution Report for PR #8658Target PR: block/buzz#8658 — BUZZ-413: Fence stream and forum message writes 1. Problem & Root CausePR #8658 was marked as
2. GitHub PR Comment Draft (for @ravarora2)Hi @ravarora2,
I rebased PR #8658 onto the latest `main` branch to resolve the merge conflict with commit `d6196a16c1` (#8237, *revoke invitations and restrict claims*):
- In `crates/buzz-db/src/error.rs`: Preserved both the new invitation restriction error variants (`InviteRestricted`, `InviteOwnerMismatch`) and `UserDeletionRestricted`.
- In `crates/buzz-db/src/store/user.rs`: In `set_agent_owner_with_operation`, preserved `lock_admission` alongside `guard_agent_owner_assignment` in canonical order so both invitation admission gating and user-deletion ownership fencing are held before the atomic `UPDATE`.
You can pull the rebased commit directly into your branch:
```bash
git fetch https://github.com/presentyourlove/buzz.git fix/fence-stream-forum-writes-8658
git rebase 59097c94ca0fcb615988facc6877cdc467449c7dOr apply the patch: curl -sL https://github.com/presentyourlove/buzz/commit/59097c94ca0fcb615988facc6877cdc467449c7d.patch | git am |
This branch has not been deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Make new stream/forum messages and replies respect the user-deletion restrictions added in #8632. HTTP and WebSocket writes check restrictions inside the transaction that persists the message. A restricted sender receives a fixed rejection; rejected replies do not change thread counters.
The writer uses shared identity locks through commit. It resolves agent ownership from PostgreSQL, locks the owner and signer, and rechecks ownership after waiting. Restrictions still apply after a profile is deleted or recreated. Agent-owner assignment now coordinates with those locks and refuses restricted owners or agents.
This is a partial serving integration: kinds 9, 40002, 45001, and 45003. It adds no migration, trigger, function, foreign key, backfill, or new batch-read API. Other writes and external-work draining remain follow-ups. Do not enable real fencing until all required paths are protected and deployed on every writer.
Implementation and coverage: user-deletion-message-fencing.md.
Related issue
Part of BUZZ-413. Follows merged #8632. No duplicate message-fencing PR found; #8489 covers workflow scaffolding and #8645 covers owned-community handlers.
Testing
Passed 116 selected PostgreSQL regressions covering message persistence, ownership, fences, and community deletion. The additional local-relay regression passed through HTTP over TCP and the WebSocket EVENT handler, including unchanged counters after rejected replies.
Mutation check: temporarily removing both production guard calls made the restriction regression fail because it accepted a fenced message. Both calls were restored before final validation.
To reproduce the focused behavior with test PostgreSQL and Redis configured:
scripts/postgres-test-run.sh -p buzz-db -p buzz-relay --lib -E 'test(/user_deletion_write_guard/) | test(/user_deletion_message/)'.All normal pre-push hooks and the full local
just cirun passed.The full
just testrun had one failure:composition_tests::composition_log_does_not_leak_issuer_urlmissed an expected warning in captured logs. The same compiled test passed when rerun alone. Every other test group, including workspace integration tests, passed. This log-capture failure also occurred during validation of #8632; no relay logging code is changed here.This remains a draft pending human validation.
Generated with Codex