Skip to content

fix(ui): re-add pruned members on reaction, delete, and edit actions#199

Merged
sanity merged 4 commits intomainfrom
fix-reaction-member-readd
Mar 26, 2026
Merged

fix(ui): re-add pruned members on reaction, delete, and edit actions#199
sanity merged 4 commits intomainfrom
fix-reaction-member-readd

Conversation

@sanity
Copy link
Copy Markdown
Contributor

@sanity sanity commented Mar 26, 2026

Problem

When a user is pruned from the members list for inactivity, posting a regular message re-adds them automatically by including a members and member_info delta alongside the message. However, reactions, deletes, and edits did NOT include this re-addition delta — they only sent recent_messages.

Since apply_delta in message.rs filters out messages from non-members, these actions were silently dropped by the contract. Users who had been pruned could send messages (which re-added them) but could not react to, edit, or delete messages.

Approach

Extracted the member re-addition logic from the send handler into RoomData::build_rejoin_delta() — a shared method that computes the members and member_info deltas needed to re-add a pruned user. This mirrors the approach riverctl already uses with its shared build_rejoin_delta() function in cli/src/api.rs.

All four action handlers (send, react, delete, edit) now call build_rejoin_delta() to include the re-addition delta when needed.

Testing

  • cargo check -p river-ui --target wasm32-unknown-unknown --features no-sync — compiles clean
  • cargo make test — all workspace tests pass
  • cargo fmt + cargo clippy — clean
  • riverctl already handles this correctly via its shared build_rejoin_delta() — no changes needed there

[AI-assisted - Claude]

sanity and others added 4 commits March 26, 2026 11:57
When a user is pruned from the members list for inactivity, posting a
message re-adds them automatically. However, reactions, deletes, and
edits did not include the member re-addition delta, causing those
actions to be silently dropped by the contract (messages from
non-members are filtered out in apply_delta).

Extract the re-addition logic into RoomData::build_rejoin_delta() and
call it from all action handlers, matching the approach riverctl already
uses with its shared build_rejoin_delta() function.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ogic

The identical 14-line try_read/build_rejoin_delta pattern was repeated
in all 4 message handlers (send, react, delete, edit). Extract into a
single helper function, reducing duplication by ~30 lines.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Cover all code paths: already-a-member, owner, no credentials,
pruned-with-credentials, stored member_info, and invite chain inclusion.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…join_delta

Removes duplicated inline rejoin logic in nickname_field.rs, replacing
it with a call to RoomData::build_rejoin_delta() for consistency.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@sanity sanity merged commit a8b5744 into main Mar 26, 2026
5 checks passed
@sanity sanity deleted the fix-reaction-member-readd branch March 26, 2026 17:19
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.

1 participant