Skip to content

fix(relay): distinguish unknown channel from not-a-member rejections - #7856

Closed
BachirSaaS wants to merge 1 commit into
block:mainfrom
BachirSaaS:fix/relay-channel-not-found
Closed

BachirSaaS wants to merge 1 commit into
block:mainfrom
BachirSaaS:fix/relay-channel-not-found

Conversation

@BachirSaaS

Copy link
Copy Markdown

Summary

restricted: not a channel member was returned for two very different conditions: the pubkey really is not a member of an existing channel, and the channel does not exist on this relay at all. Case 2 means the client is talking to the wrong relay, but on the wire it was indistinguishable from a permissions problem (#7517).

Extract open_visibility_or_unknown() for the two open-visibility fallback lookups (the generic membership gate and the edit-ownership re-gate):

  • ChannelNotFound now maps to unknown: channel not found on this relay
  • all other lookup errors keep failing closed to the previous membership rejection

The per-channel CLOSED exact-match list in buzz-acp (CHANNEL_ACCESS_DENIED_REASONS) is unaffected — clients that special-case the old string see it unchanged.

Testing

cargo test -p buzz-relay --lib open_visibility — new pure test covers all four branches (missing/open/private/other-error).

Fixes #7517

@BachirSaaS
BachirSaaS requested a review from a team as a code owner September 24, 2026 00:28
@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

🔐 Codex Security Review

Status: review required for the current range.

The current range is d01e5f82058463709a22e93bb4cd795da5f53e10...bc910f85b8089ca8edd5a027bb2579f1cc5e5a20.
A new review must complete for this exact range. When manual authorization
is required, a Block organization member must comment exactly
@buzz-security-review bc910f85b8089ca8edd5a027bb2579f1cc5e5a20 to authorize a new review.
Any previous review applies only to its recorded range.

'restricted: not a channel member' was returned for two different
conditions: the pubkey really is not a member of an existing channel,
and the channel does not exist on this relay at all. Case 2 means the
client is talking to the wrong relay, but on the wire it was
indistinguishable from a permissions problem (block#7517).

Extract open_visibility_or_unknown() for the two open-visibility
fallback lookups (generic membership gate + edit-ownership re-gate):
ChannelNotFound now maps to 'unknown: channel not found on this relay'
while all other lookup errors keep failing closed to the previous
membership rejection.

Signed-off-by: BachirSaaS <bachir.dagodi@gmail.com>
@BachirSaaS
BachirSaaS force-pushed the fix/relay-channel-not-found branch from 620e3de to bc910f8 Compare September 24, 2026 01:17
@BachirSaaS

Copy link
Copy Markdown
Author

Closing — we'll maintain these fixes in our fork instead. Thanks for the look.

@BachirSaaS BachirSaaS closed this Sep 24, 2026
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.

Relay: restricted: not a channel member is also returned when the channel does not exist on this relay

1 participant