fix(ui): preserve nickname when re-adding pruned user#101
Merged
Conversation
The publish-river-test pipeline was broken - it published the production-pathed archive to a test contract, so assets never loaded. Add compress-webapp-test task that replaces the hardcoded production contract ID with the test contract ID via binary find-and-replace, and update sign/publish tasks to use it. Also remove unused RIVER_BASE_PATH env var from build-ui. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Rebuild room_contract.wasm to include post_apply_cleanup member pruning from commit 58ab2e7. The previous WASM predated the pruning changes so new rooms would not have had automatic member lifecycle. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When a user gets pruned for inactivity, their member_info (containing nickname) is removed. On rejoin the nickname was hardcoded to "Member". Cache the user's AuthorizedMemberInfo in RoomData.self_member_info and use it during rejoin so the nickname survives the prune/re-add cycle. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Call capture_self_membership_data in apply_delta and update_room_state so the cached nickname stays current after syncs and nickname edits - Use max_by_key(version) instead of find() for version safety - Add unit test for capture_self_membership_data verifying nickname capture and update behavior Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <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 gets pruned for inactivity,
post_apply_cleanupremoves both theirmembersentry and theirmember_info(which contains their nickname). When they send a new message and get re-added, the rejoin code hardcodes the nickname to"Member"— losing the user's actual display name.Approach
Cache the user's
AuthorizedMemberInfoin a newRoomData.self_member_infofield (alongside the existingself_authorized_member). The capture method is renamed fromcapture_self_authorized_membertocapture_self_membership_dataand now always updates the cached member info to the latest version fromroom_state.member_info, so nickname edits are also preserved.On rejoin, the stored
self_member_infois used instead of constructing a new one with a hardcoded "Member" nickname. Falls back to the old behavior when no stored info exists (first-time members).No delegate or contract changes needed —
RoomDatais serialized/deserialized by the UI, and the delegate stores opaque bytes. The new field uses#[serde(default)]for backward compatibility.Testing
cargo test -p river-core— passescargo check -p river-ui --target wasm32-unknown-unknown --features no-sync— compiles (pre-existing WASM artifact errors in worktree only)Files changed
ui/src/room_data.rs— addself_member_infofield, rename and extend capture methodui/src/components/conversation.rs— use stored info in rejoin deltaui/src/components/app/freenet_api/response_handler/get_response.rs— update struct literal and method callui/src/example_data.rs— update struct literal[AI-assisted - Claude]