feat(wallet): show wasm_memory_persistence upgrade options on change canister requests - #660
Conversation
…canister requests The station (#634), the dfx-orbit CLI and the wallet Install form (#641) already accept `wasm_memory_persistence` and `skip_pre_upgrade` on external canister upgrades, but reviewers had no readable view of them: `ChangeExternalCanister` requests rendered through the generic `UnsupportedOperation` JSON dump in both the request list and the request detail dialog. Add a dedicated `ChangeExternalCanisterOperation` request view that shows the target canister (resolving its name in detail mode when possible), the install mode, the Wasm memory persistence and skip-pre-upgrade options of an upgrade, and the module/argument checksums. The compact list view only surfaces the upgrade options when they were explicitly set, while the detail view always shows the effective values so approvers can see whether main memory will be kept or replaced. Also document the upgrade options in the external canisters user guide. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019wAX3aCg6ov8rMvYeBxbgK
|
CI status on The failing test is Re-running the failed job once; I'll keep watching the PR. Generated by Claude Code |
There was a problem hiding this comment.
🟡 Changes recommended
The compact view mishandles explicit false values, and target names are fetched without verification.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds readable external-canister upgrade details to wallet request reviews and documents upgrade options.
Changes:
- Adds a dedicated change-canister request renderer.
- Displays persistence, pre-upgrade, target, mode, and checksums.
- Adds documentation and component tests.
File summaries
| File | Description |
|---|---|
docs/src/content/docs/users/external-canisters.md |
Documents upgrade options. |
apps/wallet/src/components/requests/RequestListItem.vue |
Uses the dedicated list renderer. |
apps/wallet/src/components/requests/RequestDetailView.vue |
Uses the dedicated detail renderer. |
apps/wallet/src/components/requests/RequestDetailView.spec.ts |
Tests detail-view integration. |
apps/wallet/src/components/requests/operations/ChangeExternalCanisterOperation.vue |
Implements request rendering and name resolution. |
apps/wallet/src/components/requests/operations/ChangeExternalCanisterOperation.spec.ts |
Tests rendering behavior. |
Review details
- Files reviewed: 6/6 changed files
- Comments generated: 2
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…names with a verified call Address review findings on the change canister request view: - The compact list view decided whether to show the skip-pre-upgrade row from the flag's truthiness, so a request that explicitly set `skip_pre_upgrade = false` hid the row instead of showing "No". Check whether the optional field is present instead, and cover it in the spec. - The target canister name shown to approvers was fetched with a plain query while the request itself is loaded through a verified call. Fetch the name with a verified call as well so a non-consensus response cannot attach a misleading name to the verified canister id. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019wAX3aCg6ov8rMvYeBxbgK
|
✅ No security or compliance issues detected. Reviewed everything up to 0adb7a2. Security Overview
Detected Code Changes
|
|
Status after merging This is not caused by this PR:
There is no fix for the flaky disaster-recovery e2e test on Generated by Claude Code |
Summary
Completes the
wasm_memory_persistencesupport for external canister upgrades across the CLI and the frontend.The station (#634), the dfx-orbit CLI and the wallet Install form (#641) already accept
wasm_memory_persistenceandskip_pre_upgradeon external canister upgrades. The remaining gap was on the review side of the wallet:ChangeExternalCanisterrequests rendered through the genericUnsupportedOperationJSON dump in both the request list and the request detail dialog, so approvers had no readable view of whether an upgrade keeps or replaces the canister's main memory.What changed
Wallet (
apps/wallet)ChangeExternalCanisterOperationrequest view, wired intoRequestDetailViewandRequestListItem, showing:get_external_canisterin detail mode, falling back to the canister id),skip_pre_upgrade = falseis shown as "No"); the detail view always shows the effective values for an upgrade.external_canisters.*andterms.*locale keys, so en/fr/pt stay in parity without new strings.Docs
docs/src/content/docs/users/external-canisters.md: documents the Wasm Memory Persistence and skip-pre-upgrade options in the canister upgrade steps, including the Motoko Enhanced Orthogonal Persistence requirement forKeep.dfx-orbit CLI
request canister install/verify canister installalready expose--wasm-memory-persistence keep|replaceand--skip-pre-upgrade, andreviewprints them. Re-verified withcargo test -p dfx-orbit --lib(5 tests pass).Tests
ChangeExternalCanisterOperation.spec.ts(12 tests): mode labels, upgrade options in list vs. detail mode, explicitskip_pre_upgrade = falsein list mode, default persistence shown for plain upgrades, options hidden for install/reinstall, canister name resolution through a verified call and fallback, no lookup in list mode.RequestDetailView.spec.ts: new test asserting change-canister requests render through the dedicated view with their persistence option.vitestovercomponents/requests,components/external-canisters,components/inputs,mappers: 182 tests / 46 files pass.vue-tsc --noEmit,eslintandprettier --checkon the changed files pass.e2e-tests:required. (The first CI run hit the known-flakydisaster-recovery.spec.tsend-to-end test, which fails intermittently on unrelated PRs too; see the comment below.)Not changed on purpose
SystemUpgrade(station / upgrader) does not carrywasm_memory_persistence: both are Rust canisters, for which the IC rejectskeep, so the option is not meaningful there.🤖 Generated with Claude Code
https://claude.ai/code/session_019wAX3aCg6ov8rMvYeBxbgK