Repository navigation
fix(dpns): say what helps when the username key is not on this device - #1076
Conversation
Add registration_key_status, which separates an identity that publishes no key able to register a username from one whose suitable key is simply not held on this device, and plan_restores_registration_key, which says whether a previous-version recovery plan would bring such a key back. Both are pure and read only data the record and the existing recovery plan already carry, so the UI can pick the right guidance without a second detection. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The disabled "Get a username" button told every identity that could not register to add a key. That is only right when the identity has no suitable key at all. When the key exists but this device does not hold it, adding a key is neither possible nor what the user needs. The Usernames card now picks the guidance from the key status: - no suitable key: unchanged, "Add a key" link; - key saved by an earlier version and restorable: the existing restore offer is hosted in place, with its "Restore keys" button; - updated install with nothing to offer in place: points to Restore from Previous Version, with "Open Settings" and "Open keys" links; - new install: says to enter the key, with an "Open keys" link. The identity hub becomes a fourth host of the existing offer. It reuses LegacyRecoveryState and host_offer unchanged, sends the detection task only on a frame with no other action so it never displaces a click, and routes recovery results and errors back to the card. The register screen shows the same sentence and links without hosting the offer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…istration Reproduce the state behind the disabled username button after an update: the identity publishes a key that can register usernames, the stored record does not hold it, and the previous version's data does. Restore from Previous Version is what makes the identity able to register. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Record the new behaviour in the changelog, add the acceptance bullet to DPN-001, and align USR-FR-005 and USR-TC-024 with the four cases the Usernames card now tells apart. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 39 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Waiting for bot review — coderabbitai skipped after its own rate limit · thepastaclaw not yet. Wait for the missing reviews, or a writer can post |
|
⏹️ Not reviewed — PR is closed (merged) (commit 6be1b19) |
thepastaclaw
left a comment
There was a problem hiding this comment.
Final validation — Phase 2 only (no Phase 1 for this repository)
The supplied Phase-2 finding is valid: the new Usernames card tests cover restore dispatch and failure/retry, but not successful completion followed by registration-ready UI reconciliation. This is a non-blocking coverage improvement; no blocking defect was established. Verification was static, and the supplied exact-head CI snapshot reports successful Test Suite, Clippy, and platform-pin checks, with PR Hygiene pending.
🟡 1 suggestion(s)
Review provenance
Source: reviewer 1: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 2: gpt-6.1-sol (agent: phase2-reviewer, role: rust-quality); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)
- Triage:
normalbygpt-6.1-sol(effort low) — This cross-cutting model and UI change adds registration-key classification and reuses existing recovery workflows, but does not itself change key storage, signing, cryptography, or migration logic. - Phase 1 reviewers: not run (disabled for this repository)
- Fresh verifier:
gpt-6.1-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.1-sol— general (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— rust-quality (completed, effort high); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.
In `tests/kittest/username_key_hint.rs`:
- [SUGGESTION] tests/kittest/username_key_hint.rs:184-190: Cover the card becoming registration-ready after a successful restore
This test verifies the restore offer, dispatched items, in-flight guard, and failure/retry transition, but never delivers a successful completion. The new hub host relies on SettingsTab re-reading the persisted identity on a subsequent frame and UsernamesCard then dropping its recovery state. The backend regression exercises the Settings-wide legacy_restore::run path, and the existing SettingsTab unit test checks identity replacement in isolation; neither covers this card-specific success transition. Add a companion test that updates the stored identity to hold the signing key, delivers LegacyRecoveryCompleted through display_backend_task_result using the dispatched context, renders subsequent frames, and asserts that the missing-key guidance and restore offer disappear and clicking "Get a username" emits the registration-screen action. This protects the PR's explicit promise that restoring the key enables registration without leaving the card.
|
Ready for review — files with no dedicated owner: lklimek. |
The card test delivered the restore offer, the dispatch and a failed restore, but never a successful completion. Add the success path through the identity hub: the stored record gains the key, the completion is delivered on the dispatched context, and the card then drops the guidance and the offer, confirms the restore, sends no further check of the previous version's data, and opens the registration screen from "Get a username". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Waiting for bot review — coderabbitai not yet · thepastaclaw not yet. Wait for the missing reviews, or a writer can post |
|
/skip-bots |
|
Policy satisfied — this can merge. |
TL;DR: After an update, an identity could show a disabled "Get a username" button with the advice "Add a key to this identity to register usernames." That advice was wrong whenever the identity already had a suitable key that simply was not on this device. The card now says what actually helps and, when the earlier version saved the key, offers to restore it right there.
User story
As a user who updated Dash Evo Tool and wants a username, I want the app to tell me why the button is disabled and let me fix it from where I am, so that I do not go looking for a way to add a key I already have.
Scenario
Base flow
Actual behavior
Expected behavior
The card says why the button is disabled and what helps:
Add a keyRestore keysOpen Settings,Open keysOpen keysAfter a restore the button is enabled. The username registration screen shows the same sentence and links.
Detailed discussion
What was done
registration_key_status(src/model/dpns_usernames.rs), separates "no suitable key" from "key not on this device" using the keys the identity publishes.LegacyRecoveryState,host_offer,CheckLegacyRecovery,RecoverLegacyIdentityData) unchanged; the identity hub becomes its fourth host.plan_restores_registration_keyonly asks whether the plan that detection already returned contains a key that can register.AppAction |=keeps only the last action and a background task must not displace a click.docs/user-stories.md(DPN-001) and the usernames redesign spec (USR-FR-005, USR-TC-024) describe the new guidance.Known limitations:
Out of scope, not changed here:
Testing
cargo test --all-features --test kittest(whole binary): 442 passed.cargo test --all-features --lib -- ui::identity:: model::dpns_usernames recover_legacy_keys: 414 passed.cargo clippy --all-features --profile test --lib --test kittest -- -D warnings: clean.upgraded_install_without_an_offer_points_to_the_settings_restore,identity_without_its_key_on_this_device_is_told_to_enter_it,usernames_card_without_the_key_on_this_device_offers_to_enter_it,card_offers_the_restore_when_the_previous_version_holds_the_key,card_ignores_a_restore_offer_for_another_identity.card_enables_registration_once_the_restore_completescovers the success path through the hub: after the restore completes the guidance and the offer are gone and "Get a username" opens the registration screen. It fails when the hub stops routing the completed result, when the Settings tab stops re-reading the identity, and when the card never drops its recovery state. The backend restore is not run in it; the stored identity is rewritten with the key.identity_without_a_suitable_key_is_told_to_add_one,no_recovery_check_without_a_missing_key_or_previous_version_data, andrestoring_a_stranded_signing_key_lets_the_identity_register_usernames, which reproduces the reported state in the backend (record without keys, earlier data holding the key → restore → registration allowed).Breaking changes
None.
Prior work
🤖 Co-authored by Claudius the Magnificent AI Agent
🤖 Generated with Claude Code
https://claude.ai/code/session_012YneRVSNLhVnGiedWDr3fw
PR Hygiene ·
6be1b19CHANGELOG.md,docs/ai-design/2026-10-01-usernames-redesign/01-requirements.md,docs/ai-design/2026-10-01-usernames-redesign/03-test-case-spec.mdand 12 more) — approved by lklimekWhen every merge requirement is met, the
PR Hygienecheck passes. Reviewer limits do not block merging; other required GitHub checks and protections still apply.