-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
Problem
When the room contract WASM is updated (e.g., to fix bugs like the StateSummary size issue), existing rooms cannot be upgraded in place. The contract key is derived from hash(WASM + parameters), so changing the WASM produces a different contract key, effectively creating a new room.
Currently, upgrading requires:
- Recreating the room with new WASM
- Users manually migrating to the new room
- Losing message history or manually migrating state
Proposed Solution
Implement a graceful upgrade mechanism using the existing upgrade: OptionalUpgradeV1 field in ChatRoomStateV1:
Phase 1: Basic Upgrade Pointer
- Room owner can set the
upgradefield to point to a new contract key - UI/CLI detects upgrade pointer and prompts users to migrate
- Old room remains readable but new messages go to upgraded room
Phase 2: Automatic Migration (Future)
- UI automatically follows upgrade pointers
- State migration tooling to copy messages/members to new room
- Invitation links could resolve through upgrade chain
Context
Discovered while investigating #StateSummary size issue - the Official Freenet room was created with old contract WASM that serializes full state instead of compact summaries (14KB vs ~500 bytes). The only current fix is room recreation.
Tasks
- Add
riverctl room upgrade <old-room> <new-room>command to set upgrade pointer - UI: Detect and display upgrade notifications
- UI: "Follow upgrade" button to subscribe to new room
- Documentation for room upgrade process
- (Future) State migration tooling
[AI-assisted - Claude]
Metadata
Metadata
Assignees
Labels
No labels