Repository navigation
feat(relay): add conditional Solo member role updates - #9667
Conversation
Apply signed role changes to active Solo members at their expected role. Permit access reductions, require verified agent ownership for elevation, and refresh signed group state without sending admission notices. Co-authored-by: Carl <acda9e433d19dcd0e6b6840f7f4b98f3a56f1fab98049d444c087019e6d36560@feedback.communities.buzz.xyz> Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
Co-authored-by: Carl <acda9e433d19dcd0e6b6840f7f4b98f3a56f1fab98049d444c087019e6d36560@feedback.communities.buzz.xyz> Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
🔐 Codex Security Review
Review SummaryOverall Risk: NONE
FindingsNo concrete security, correctness, or reliability findings were identified. Notes
Generated by Codex Security Review | |
wesbillman
left a comment
There was a problem hiding this comment.
🤖 Star Lord recommends changes at 1fb400a. An accepted Solo role edit can leave the relay-signed roster stale and block later edits. Source review only.
The locked Solo guard accepted any stream labelled buzz.solo, so an open channel carrying that label let the owner's kind 9050 skip the ordinary role-change policy and its notices. Require private visibility, matching the Solo definition in the mobile contract. Signed-off-by: Tom Brow <tomb@block.xyz>
brow
left a comment
There was a problem hiding this comment.
🤖 The pre-review recommends landing this with one small fix, #9677 refuse Solo role changes on open channels: without it, the relay accepts the new role command on any channel labelled buzz.solo, including an open one, where the owner can silently change the role of someone else's agent that its invitation policy protects. Please merge the fix into your branch (it needs no approval there, since it targets your branch), and this PR is then approved and merged on Tom's go-ahead.
Publish the kind:9050 capability in NIP-11 so clients can support independent rollout. Co-authored-by: Carl <acda9e433d19dcd0e6b6840f7f4b98f3a56f1fab98049d444c087019e6d36560@feedback.communities.buzz.xyz> Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
* commit '5595b1c647bd4238bd38526c532daadeef6f602c': fix(relay): refuse Solo role changes on open channels Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
Replace the signed admin and member lists before committing the role change. Roll back the command and role together if either list write fails so the same command can be retried. Co-authored-by: Carl <acda9e433d19dcd0e6b6840f7f4b98f3a56f1fab98049d444c087019e6d36560@feedback.communities.buzz.xyz> Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
Keep the Solo role command import and the artifact policy import. Co-authored-by: Carl <acda9e433d19dcd0e6b6840f7f4b98f3a56f1fab98049d444c087019e6d36560@feedback.communities.buzz.xyz> Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
|
🤖 @brow @wesbillman Both review findings are addressed at The relay now accepts Solo role edits only on private streams, including the guard from #9677. It stores the command, role, signed admin list, and signed member roster in a single transaction. A roster write failure rolls back the entire edit, so the same signed command can be retried. Six PostgreSQL regressions passed on that head, including open-channel rejection, rollback and retry, the Solo role workflow, and the upstream artifact-policy checks. The NIP-11 capability test also passed. All five pre-push hooks passed. |
…ction-p * origin/main: (200 commits) fix(mobile): keep open shared sessions in Solo (#9704) fix(mobile): align channel indicators and Duo section menus (#9703) fix(mobile): allow person mentions in Solo chats (#9705) fix(mobile): let code scroll under the code block copy button (#9612) Transcribe Bestie hold recordings into text on device (#9645) feat(cli): show and search verified identity in users get (#9647) fix(mobile): keep agent poster up until the iOS video draws (#9688) test(relay): stop bridge cancel_fixture tests timing out on the first replica connect (#9691) Revert "feat(relay): support community-scoped NIP-AR artifacts" (#9689) feat(relay): add conditional Solo member role updates (#9667) feat(mobile): add saved channel section filters (#8479) feat(relay): support community-scoped NIP-AR artifacts (#9650) feat(mobile): add a diagnostics test report and test crash to Settings (#9676) fix(pubsub): round the rate-limit retry hint up from PTTL (#9552) feat(mobile): add diagnostic reporting module with crash capture (#9613) fix(mobile): recover stuck read-state updates and stale Mark Read (#9492) test(relay): refresh the author's membership cache after the stray-h private channel insert (#9640) fix(mobile): name the cause of account-unavailable sign-in errors (#9628) perf(db): bound deep keyset history pages by the cursor timestamp (#9549) feat(cli)!: consistent channels list/get/search output (type, visibility, labels, real created_at) (#9617) ... Signed-off-by: Matthew Boston <mboston@squareup.com>
…eaction-recipients * origin/main: (72 commits) fix(mobile): keep open shared sessions in Solo (#9704) fix(mobile): align channel indicators and Duo section menus (#9703) fix(mobile): allow person mentions in Solo chats (#9705) fix(mobile): let code scroll under the code block copy button (#9612) Transcribe Bestie hold recordings into text on device (#9645) feat(cli): show and search verified identity in users get (#9647) fix(mobile): keep agent poster up until the iOS video draws (#9688) test(relay): stop bridge cancel_fixture tests timing out on the first replica connect (#9691) Revert "feat(relay): support community-scoped NIP-AR artifacts" (#9689) feat(relay): add conditional Solo member role updates (#9667) feat(mobile): add saved channel section filters (#8479) feat(relay): support community-scoped NIP-AR artifacts (#9650) feat(mobile): add a diagnostics test report and test crash to Settings (#9676) fix(pubsub): round the rate-limit retry hint up from PTTL (#9552) feat(mobile): add diagnostic reporting module with crash capture (#9613) fix(mobile): recover stuck read-state updates and stale Mark Read (#9492) test(relay): refresh the author's membership cache after the stray-h private channel insert (#9640) fix(mobile): name the cause of account-unavailable sign-in errors (#9628) perf(db): bound deep keyset history pages by the cursor timestamp (#9549) feat(cli)!: consistent channels list/get/search output (type, visibility, labels, real created_at) (#9617) ... Signed-off-by: Matthew Boston <mboston@squareup.com>
…c-spec-mobile * origin/main: fix(mobile): keep glass controls mounted and the wide thread push parallax (#9726) fix(mobile): stabilize Duo chat switching and sheet layering (#9717) Require relay schema owner review for migrations and schema (#9708) fix(relay): resurface a hidden DM when someone else messages it (#9678) fix(deploy): pin self-host installs to relay 0.3.0 (#9714) fix(mobile): keep open shared sessions in Solo (#9704) fix(mobile): align channel indicators and Duo section menus (#9703) fix(mobile): allow person mentions in Solo chats (#9705) fix(mobile): let code scroll under the code block copy button (#9612) Transcribe Bestie hold recordings into text on device (#9645) feat(cli): show and search verified identity in users get (#9647) fix(mobile): keep agent poster up until the iOS video draws (#9688) test(relay): stop bridge cancel_fixture tests timing out on the first replica connect (#9691) Revert "feat(relay): support community-scoped NIP-AR artifacts" (#9689) feat(relay): add conditional Solo member role updates (#9667) feat(mobile): add saved channel section filters (#8479) feat(relay): support community-scoped NIP-AR artifacts (#9650) feat(mobile): add a diagnostics test report and test crash to Settings (#9676) fix(pubsub): round the rate-limit retry hint up from PTTL (#9552) feat(mobile): add diagnostic reporting module with crash capture (#9613) Signed-off-by: Will Pfleger <wpfleger@block.xyz> # Conflicts: # mobile/test/features/activity/activity_page_test.dart
…-workflow-verified-mentions * 'main' of https://github.com/block/buzz: (21 commits) chore: require relay owner review for the relay and db crates (#9728) fix(mobile): align Huddle cards and preserve conversation navigation (#9713) Match mobile mention chips to desktop styling (#9706) feat(relay): push mentions to people outside a listed channel (#9623) fix(db): undo migration 0097 (#9710) fix(mobile): keep glass controls mounted and the wide thread push parallax (#9726) fix(mobile): stabilize Duo chat switching and sheet layering (#9717) Require relay schema owner review for migrations and schema (#9708) fix(relay): resurface a hidden DM when someone else messages it (#9678) fix(deploy): pin self-host installs to relay 0.3.0 (#9714) fix(mobile): keep open shared sessions in Solo (#9704) fix(mobile): align channel indicators and Duo section menus (#9703) fix(mobile): allow person mentions in Solo chats (#9705) fix(mobile): let code scroll under the code block copy button (#9612) Transcribe Bestie hold recordings into text on device (#9645) feat(cli): show and search verified identity in users get (#9647) fix(mobile): keep agent poster up until the iOS video draws (#9688) test(relay): stop bridge cancel_fixture tests timing out on the first replica connect (#9691) Revert "feat(relay): support community-scoped NIP-AR artifacts" (#9689) feat(relay): add conditional Solo member role updates (#9667) ... Signed-off-by: Camilo Sanchez <camilos@squareup.com>
## Overview **Category:** improvement **User Impact:** Owners of Private Solo chats can change existing members’ access from the member menu when their relay supports Solo role updates. **Problem:** The Solo member menu offered removal as the only way to change an existing member’s access. **Solution:** Owners can lower the access of current non-owners, restore participation for verified agents, and grant Admin to their own verified agents. The app checks relay support, signed Private visibility, and current membership before signing and again before publishing. The relay applies the conditional command only if the target’s current role still matches. ## Changes - Reuse the existing role menu and confirmation in Chat access. A person can be downgraded to Viewing only. To restore their participation, remove and invite them again. - Enable role edits on web and desktop when the relay advertises `buzz-solo-member-role` in NIP-11. Member removal is available independently. - Sign and publish kind `9050` through the purpose-bound writer. The command carries the expected role, and the app checks the updated signed roster before reporting success. Relay support is in block/buzz#9667. - Cover permission differences, stale roster and profile checks, the web and native signing contract, and the browser role-change flow. ## Reproduction steps 1. On a supporting relay, open **Access** as the owner of a Private Solo chat with a participating agent you own and another participant. 2. Open the agent’s menu, choose **Admin**, then cancel. Reopen the menu and verify the agent remains **Participating**. 3. Choose **Admin** again and confirm. Reopen the menu and verify the new selection after the roster refreshes. 4. Open the other participant’s menu and verify that you can lower their access. On a View only chat or a relay without the capability, verify that the role choices are absent and member removal is still available. ## Validation - Required CI and DCO passed on `0e2251a892`. Chromium and WebKit covered the application flow against a simulated relay. [CI run](https://github.com/block/buzz-app/actions/runs/44435871254/attempts/2) - All 226 affected Vitest tests passed on `b741f17a17`, including the shared Bot-to-Admin fixture and the native transport’s self-target rejection. - The Rust production IPC signing test passed on `b741f17a17`. - An isolated PostgreSQL-backed relay built from the same relay source as block/buzz#9667 advertised the capability, accepted two downgrades, and refused both an Admin grant without matching relay ownership and a role edit after removal. The client verified the relay-signed roster after each change. The probe exercised the app’s command protocol over WebSocket. ## Recording A short walkthrough of the owner opening agent access, canceling without a change, confirming Admin access, and verifying the saved role after reload. Recorded from the real Buzz UI at `e6dfcaaf4f` with fictional people and messages and a simulated relay. This recording demonstrates the agent promotion flow using the earlier implementation. https://github.com/user-attachments/assets/f719ee6f-d017-4034-be08-753fa996117e ## Screenshots Captured at `e6dfcaaf4f` with disposable fixture data, dark theme, and normal text size. | Before | Proposed agent menu | | --- | --- | |  |  | Promoting the agent opens a confirmation.  --------- Signed-off-by: Taylor Ho <taylorkmho@gmail.com> Co-authored-by: Carl <acda9e433d19dcd0e6b6840f7f4b98f3a56f1fab98049d444c087019e6d36560@feedback.communities.buzz.xyz>
Category: improvement
User Impact: Solo chat owners can lower the access of any current non-owner, including people and agents.
Problem: Using invitations to change Solo chat access can restore a removed member, reject a downgrade because of the target’s invitation policy, or show a join notice for a role change.
Solution: Add signed role updates that require an active member at the expected role when the relay commits the change. A Solo owner can downgrade any current non-owner. Moving a viewer to Participating requires a verified agent, and granting Admin requires ownership of that agent. The relay refreshes signed group state without emitting a join notice.
Companion to block/buzz-app#3704. The app review identified the need for conditional writes, verified agent identity and live relay validation. #9592 introduced the atomic removal that uses the same membership lock.
File changes
crates/buzz-core/src/kind.rs
Register signed Solo role updates as kind 9050.
crates/buzz-db/src/store/channel_members.rs
Authorize the transition under the channel membership lock and commit the active row update and signed event together.
crates/buzz-relay/src/handlers/event.rs
Give the new command a bounded metrics label.
crates/buzz-relay/src/handlers/ingest.rs
Use the shared signed ingest path and require the channel administration scope.
crates/buzz-relay/src/handlers/mod.rs
Register the command handler and its PostgreSQL test.
crates/buzz-relay/src/handlers/solo_member_role.rs
Parse the command, route it to the conditional write, and refresh signed group state after commit.
crates/buzz-relay/src/handlers/solo_member_role_postgres_tests.rs
Exercise human and agent changes, restrictive invitation policy, promotion authorization, stale and removed membership, duplicate receipt, and signed roster updates through the relay’s production ingest path.
docs/solo-mobile-contract.md
Describe the wire format, permitted transitions, and handling when an older relay rejects the command.
Try it
solo_owner_edits_active_members_and_publishes_the_new_rosterwith PostgreSQL to check that a pending change for a removed member is refused and the signed roster stays clear of that member.Validation
405f7d1da. It covers role and invite-policy enforcement, signed roster refresh, duplicate receipts, and rejection after removal.a470947dc6passes 138 administration tests. Its production command builder, validator, and signed roster reader also passed over WebSocket against a local relay backed by PostgreSQL and Redis. A human moved from Admin to Participating to Viewing only, then was removed. The app preflight and relay both refused a further role edit, and the signed roster still excluded the member.