Skip to content

Conversation

@sanity
Copy link
Contributor

@sanity sanity commented Dec 27, 2025

Summary

  • Fixes ban verification to not require banned member to still exist in member list
  • Resolves message propagation failures after kicking a user

Problem

When a user was kicked (banned), the state would become:

  • bans: contains the ban entry
  • members: banned member already removed

The ban verification would fail with MemberNotFound because it required the banned member to still be in the member list. This created an impossible state where:

  1. Banning removes the member from the list
  2. Verifying the ban requires the member to be present

Solution

If the banned member is not in the member list, the ban has already taken effect and is valid. Skip the invite chain verification in this case since:

  1. The ban signature verification still proves authenticity
  2. The invite chain was valid when the ban was first created/applied

Test plan

  • All 87 river-core unit tests pass
  • Verified this resolves the "invalid state" errors seen in user diagnostic reports

🤖 Generated with Claude Code

Previously, ban verification would fail with `MemberNotFound` if the
banned member was no longer in the member list. This created an
impossible state: banning a member removes them from the list, but
verifying the ban required them to still be present.

The fix recognizes that if a banned member is not in the member list,
the ban has already taken effect (member was removed) and is therefore
valid. The invite chain verification is skipped in this case since:
1. The ban signature verification still proves authenticity
2. The invite chain was valid when the ban was first created/applied

This fixes a bug where message propagation would fail after kicking a
user, because the merged state (with ban but without banned member)
couldn't pass validation.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@sanity sanity merged commit a7a5b11 into main Dec 27, 2025
1 check failed
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.

2 participants