fix(ui): re-add pruned members on reaction, delete, and edit actions#199
Merged
fix(ui): re-add pruned members on reaction, delete, and edit actions#199
Conversation
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>
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.
Problem
When a user is pruned from the members list for inactivity, posting a regular message re-adds them automatically by including a
membersandmember_infodelta alongside the message. However, reactions, deletes, and edits did NOT include this re-addition delta — they only sentrecent_messages.Since
apply_deltainmessage.rsfilters 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 themembersandmember_infodeltas needed to re-add a pruned user. This mirrors the approach riverctl already uses with its sharedbuild_rejoin_delta()function incli/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 cleancargo make test— all workspace tests passcargo fmt+cargo clippy— cleanbuild_rejoin_delta()— no changes needed there[AI-assisted - Claude]