Skip to content

fix(ui): use current room state when sending upgrade pointer to old contract#129

Open
sanity wants to merge 2 commits intomainfrom
fix-migration-upgrade
Open

fix(ui): use current room state when sending upgrade pointer to old contract#129
sanity wants to merge 2 commits intomainfrom
fix-migration-upgrade

Conversation

@sanity
Copy link
Contributor

@sanity sanity commented Mar 5, 2026

Summary

  • Migration code was sending a ChatRoomStateV1 with ..Default::default() for all fields except upgrade, causing the old contract to reject the UPDATE with "Invalid signature: signature error"
  • Fix: clone the current room_data.room_state and set the upgrade pointer on the clone, so the old contract's state verification passes
  • The upgrade pointer can then be followed by other clients to find the new contract

Test plan

  • cargo check -p river-ui — compiles cleanly
  • cargo make test-common — all tests pass
  • Manual verification: migrate a room from old contract version, confirm UPDATE succeeds and upgrade pointer is set

Closes #127

[AI-assisted - Claude]

sanity and others added 2 commits March 5, 2026 11:52
The `cargo make dev-example` task depends on `npm run build:css` for
Tailwind CSS, but the README didn't mention installing Node.js/npm or
running `npm install` in the `ui/` directory. New contributors following
the documented steps would hit a confusing failure.

Closes #120

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ontract

The migration code was constructing a ChatRoomStateV1 with only the
upgrade field set and all other fields left at Default::default(). This
produced an empty configuration (zeroed owner_member_id, no members,
etc.) which the old contract's state verification rejected with
"Invalid signature: signature error".

Fix: clone the current room state and set the upgrade pointer on it,
so the old contract sees a valid state that passes verification.

Closes #127

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

Contract migration sends invalid state to old contract, causing 'Invalid signature' error

2 participants