Repository navigation
fix(desktop): stop offering guests the add-members search - #9784
Draft
shani-singh1 wants to merge 1 commit into
Draft
shani-singh1 wants to merge 1 commit into
shani-singh1 wants to merge 1 commit into
Conversation
The relay's kind:9000 rule (buzz_core::channel::decide_member_put) refuses every add from a guest since announce channels (block#8143): a guest can read and leave but not write, and adding people is a write. The desktop's mirror of that rule, canAddChannelMembers, still allowed any active member of a private channel and anyone in an open channel, so a guest was offered the add-members search and every add they picked was rejected by the relay. canAddChannelMembers now returns false for a guest, as the relay does. The denial notice says the add needs a member who can post, which also reads correctly for a guest. Signed-off-by: Shani Singh <teamdeveloperworld@gmail.com>
🔐 Codex Security Review
|
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
Since #8143 (announce channels and
join_role), the relay refuses every channel add from a guest. A guest can read and leave, but not write, and adding people is a write. The rule lives inbuzz_core::channel::decide_member_put:may_add = role.can_post()can_postis false only forGuestGuestCannotAddThe relay applies it in
handlers/channel_authz.rs, and the DB applies it again under the membership lock.The 0.X desktop's copy of that rule is
canAddChannelMembersindesktop/src/features/channels/lib/channelMemberAdmission.ts. It still treated anyone in an open channel, and every active member of a private channel, as able to add, guests included. Its test, from #5493 (before #8143), even asserted that a guest can add.So a guest saw the "Add people and agents" search in the members sidebar, and the composer offered to invite mentioned people. Every add they chose was rejected with "only members can add people in this channel".
Change
canAddChannelMembersreturns false for a guest, alongside the existing DM check. Its doc comment now points atdecide_member_put.Not included: an open channel whose
join_roleis guest also refuses adds from non-members. The desktop doesn't readjoin_roletoday, so that case is unchanged.Related issue
None found. I searched PRs and issues for "guest add members desktop", "canAddChannelMembers", "guest cannot add", "channelMemberAdmission" and "guests add people", and checked open PRs touching these files. None changes who may add people.
Testing
New test:
guests never add anyone, as the relay's decide_member_put refuses.main: it fails with "a guest … must not be offered adds",true !== false.The existing private-channel test no longer expects guests to add. Results:
ForumComposer.lifecycle.test.mjs, which uses the notice text: passespnpm typecheck, biome on the changed files, andnode scripts/check-file-sizes.mjs: cleanManual check