Repository navigation
fix(tokens): keep the Token Creator's identity current and its registration state reliable - #1168
Draft
Claudius-Maginificent wants to merge 5 commits into
Draft
Claudius-Maginificent wants to merge 5 commits into
Claudius-Maginificent wants to merge 5 commits into
Conversation
… to the Token Creator The Token Creator form survives navigation, and so did its copy of the selected identity. A key added on the identity's key screen never reached it, so Simple mode kept reporting that no eligible key exists. Arrival, refresh and identity cache updates now replace the creator's identity with the stored one. A selected key the identity no longer holds is dropped, and an identity that is no longer stored is deselected. The form inputs are kept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Token Creator offers user identities that hold private keys, but it picked its starting identity from every stored identity. With a masternode or keyless identity selected, for example one stored before a wallet import, the selector showed "No identities found" next to a list of identities and Simple mode reported a missing key. The starting identity and the refreshed selection now come from the identities the creator offers. An identity it does not offer is deselected, so the selector picks one it does offer. A failed read of stored identities no longer drops the user's selection. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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. |
Collaborator
|
🕓 Review not started yet because this PR is a draft.
Commit c007ad0. Normal review starts when eligible; priority review starts as soon as a slot is available. |
A failed registration was detected by matching banner text that no TaskError produces, so the creator stayed in its waiting state. The creator now sends the registration under its own dispatch context and leaves the wait in its error state, dropping the progress banner, when a failure arrives for that context. Failures of other tasks, and late failures from before a network switch, leave it alone. <sub>🤖 Co-authored by [Claudius the Magnificent](https://github.com/lklimek/claudius) AI Agent</sub> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Create Token (and Register Token Contract under Advanced) stayed enabled while a registration was waiting for its result, so creating and confirming again paid a second registration fee. Both buttons are now disabled while the creator waits, with a visible explanation, and are enabled again once the registration succeeds or fails. <sub>🤖 Co-authored by [Claudius the Magnificent](https://github.com/lklimek/claudius) AI Agent</sub> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…asks Clicking Confirm must send the registration and the balance refresh, each under a context of its own, and leave the creator waiting for the registration's context, so that only the registration's own failure ends the wait. <sub>🤖 Co-authored by [Claudius the Magnificent](https://github.com/lklimek/claudius) AI Agent</sub> Co-Authored-By: Claude Opus 5.5 <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.
TL;DR
The Token Creator now always works with up-to-date information about the identity you picked. Keys you add elsewhere show up when you come back, and after importing a wallet it no longer says there are no identities while the list shows them. Everything you typed into the form stays. A failed token registration now shows as failed instead of waiting forever, and you can't accidentally pay for a second registration while the first is still running.
User story
As a token creator, I want the Token Creator to reflect my identity's current keys and the identities I can actually use, so that I can register a token without restarting the app or re-picking my identity.
Scenario
Steps to reproduce
Actual behavior
Expected behavior
Detailed discussion
TokensScreen.selected_identity). That snapshot was only replaced on a manual selection.refresh_token_creator_identity()replaces the selection with the stored copy (keys and balance). It runs fromrefresh_on_arrival,refreshandcached_data_changed(Identities/All).offered_by_token_creator()(User type with private keys) now drives the dropdown filter, thenew()seed and the refresh. An ineligible selection, such as a masternode or a keyless identity seeded at startup, is cleared soIdentitySelectorpicks the first offered identity.reload_identities()refreshes the selection only when loading succeeds. On failure it keeps the user's selection.seed_token_identitynow gives identities a placeholder private key generated at runtime, because the creator never offers keyless identities.BackendTasksWithContexts, and the Register context is stored intoken_registration_context.display_backend_task_errorends the wait only for that context.msg.contains(...)match indisplay_messageis removed. It was dead code: no error produces those strings, and it violated AGENTS.md's no-string-parsing rule.simple_mode_blocked_reasonandadvanced_mode_blocked_reasonreturnREGISTRATION_IN_FLIGHT_HINTwhileawaits_token_registration().Testing
src/ui/tokens/tokens_screen/mod.rs, including:a_failed_registration_ends_the_wait_in_the_error_statecreate_token_is_blocked_while_a_registration_is_in_flightconfirming_registration_waits_for_the_registration_dispatch, which drives the real Confirm and was mutation-checkedrequest_routing::a_failed_registration_puts_the_token_creator_in_its_error_state.cargo test --lib --all-features tokens_screen: 54 passed.cargo test --test kittest --all-features token: 16 passed.-D warnings.🤖 Co-authored by Claudius the Magnificent AI Agent
🤖 Generated with Claude Code