Repository navigation
fix(dashpay): save contact details through platform-wallet (DIP-15) - #1102
Claudius-Maginificent wants to merge 108 commits into
Conversation
The Profile tab cloned the hub's identity into an owned value, then cloned it again to keep the refreshed snapshot when the identity had not changed. Reconciliation now borrows the incoming identity, compares IDs by reference, and clones once when it keeps the snapshot. A refresh of the same identity still replaces the snapshot and keeps unsaved edits; a switch to another identity still resets the editor. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_012YneRVSNLhVnGiedWDr3fw
The hub drew every tab inside a centred layout that spanned the whole window, so on a wide window Home's columns, the Profile form and the Contacts cards stretched across it. Tab content now starts at the tab bar's left edge and stops at one shared width taken from the identities wireframes; the rest of a wide window stays empty. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_012YneRVSNLhVnGiedWDr3fw
The Profile tab split its width evenly with a justified layout, so on a wide window the form stretched, each username's menu floated right after the name, Get another username spanned the whole column and the identity type badge sat beside the usernames. The tab now follows the A08 wireframe: the social profile form beside a usernames card, split 560:380. Each username's menu sits at the card's right edge, Get another username is a secondary, card-wide button below a divider, and the identity type badge moves to Advanced next to the identity ID. Narrow windows still stack the two columns. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_012YneRVSNLhVnGiedWDr3fw
The Contacts tab offered Add by username twice, once in the header and again inside Active contacts, its sections shrank to their content and did not scroll, and a contact row showed only one line. Add by username now appears in the header, and inside Active contacts only as the empty state's call to action. The sections share the content width and scroll below the header, and each contact row shows the contact's @username under its name when that adds something. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_012YneRVSNLhVnGiedWDr3fw
The identity header (avatar, name, balance and its actions) still spanned the whole window while the tab content below it stopped at one width, so on a wide window the balance and Move to wallet sat far to the right of everything else. The header, the tab bar and the tab content now share one left-aligned column of the same width on every tab. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_012YneRVSNLhVnGiedWDr3fw
A username can be 63 characters long. In the Profile tab's usernames card the name sat in a row that grows to fit its text, so a long name pushed the Main badge and the ••• menu out of the card and the whole tab past its content width. A hidden contact with a long name did the same to its Unhide button. These rows now lay out their actions first and shorten the name with "…" to the room that is left, keeping room for the Main badge; hovering shows the full name. Pending and finished username requests use the same layout. Active contact rows already wrap long names and are unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_012YneRVSNLhVnGiedWDr3fw
The Profile tab cloned the selected identity twice per frame: once to keep its snapshot and again to render from it. It now renders from the identity the hub lends it and keeps the one owned snapshot only for attributing results, so steady-state frames clone it once. The profile-cache lookup borrows the snapshot as well. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_012YneRVSNLhVnGiedWDr3fw
The hub's content column was given the content width as its width, but egui's set_max_width sets the width instead of capping it. In a window narrower than that the column grew past the window: the header's balance and actions were cut off, and the Profile tab never had little enough room to stack its usernames card under the form. The column now takes the smaller of the content width and the room the window has. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_012YneRVSNLhVnGiedWDr3fw
An active contact's name and username were laid out across the whole row before View Profile and Pay, so a long nickname wrapped under the buttons. The buttons are now laid out first and the name and username are shortened with "…" to the room they leave; hovering shows the full text, the same as hidden contacts and usernames. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_012YneRVSNLhVnGiedWDr3fw
…Contacts tab Clicking a contact on the Identity Hub Contacts tab now opens a detail pane next to the list instead of the legacy DashPay profile screen. On narrow windows the pane sits under the list. It shows the contact's picture, name, @username and bio, plus Pay when DashPay payments are enabled. The pane also edits the contact's private note. The note is saved encrypted on Dash Platform through the existing contactInfo write (DashPayTask::UpdateContactInfo), which keeps the nickname, the accepted accounts and the hidden state. The estimated fee is shown before saving. A save cannot be sent twice while one is still running, and a reload never overwrites an edit in progress. When the stored details cannot be read, the hub's existing overwrite confirmation now uses wording for a note save. The 255-byte note limit now lives in model::dashpay (MAX_CONTACT_NOTE_BYTES and validate_contact_note), and the backend serializer uses the same constant. The fee estimate is in PlatformFeeEstimator::estimate_contact_info_write. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_012YneRVSNLhVnGiedWDr3fw
… the list In the two-column Contacts layout, the 24 pt gap between the columns was also applied to every row inside them. This pushed the contact's name in the detail pane 16 pt further from its picture than it sits in the narrow layout, and widened the gaps between the buttons in the sections. Each column now goes back to the normal spacing. In the contact list, the @username under a name started at the button's edge, not at the name text inside the button, so the two lines did not line up. The username now lines up with the name. Found in a visual check on testnet. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_012YneRVSNLhVnGiedWDr3fw
- Route DashPayContactInfoUpdated and DashPayContactInfoActionFailed to the hidden Identity Hub, so a note save or unhide that finishes behind another screen releases its guard and still asks before overwriting unreadable details. - Run one contactInfo write per owner and contact: a note save waits for a running unhide and vice versa, so a result can no longer settle the wrong write. - The migration gate names the owner and contact of a refused UpdateContactInfo, so the hub releases exactly that write's guard. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_012YneRVSNLhVnGiedWDr3fw
…does - Encode contactInfo private data with platform-wallet's DIP-15 codec, so 253-255-byte notes and nicknames get CompactSize length prefixes that other clients can read. - Read CompactSize lengths, and accept platform-wallet's zero padding, in the strict reader that guards writes against dropping fields. - Load contact details from every page of contactInfo documents, in the order the write lookup uses, decoded with platform-wallet's reader; the first document for a contact wins, matching the one a save rewrites. - Size the note fee from the encoded payload, including longer prefixes and the minimum padding. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_012YneRVSNLhVnGiedWDr3fw
Remove the shared width cap and verify that the header and each tab grow with the window while narrow layouts and long labels remain contained. Co-Authored-By: Codex <[email protected]> <sub>🤖 Co-authored by [Claudius the Magnificent](https://github.com/lklimek/claudius) AI Agent</sub>
Keep the full-width hub layout and profile synchronization retries alongside contact details. Adapt the layout regression to measure the note editor. <sub>🤖 Co-authored by [Claudius the Magnificent](https://github.com/lklimek/claudius) AI Agent</sub> Co-Authored-By: Codex <[email protected]>
Validate note lengths through the shared model validator and preserve the upstream codec error as a typed source. Document CompactSize encoding and distinguish the application's note limit from the wire format. Validation: 222 targeted unit tests, 65 identity hub UI tests, scoped clippy, and cargo fmt --all passed. <sub>🤖 Co-authored by [Claudius the Magnificent](https://github.com/lklimek/claudius) AI Agent</sub> Co-Authored-By: Codex <[email protected]>
Route Home contact selections to Contacts while retaining the selected profile and note during refresh. Center the detail pane's Pay label with the shared button helper. <sub>🤖 Co-authored by [Claudius the Magnificent](https://github.com/lklimek/claudius) AI Agent</sub> Co-Authored-By: Codex GPT-6 <[email protected]>
Preserve the contact details pane, Home contact navigation, and note write guards while incorporating the merged responsive hub layout and compact username actions. Validation: 67 hub tests and 25 Home tests passed; cargo fmt and scoped Clippy passed. <sub>🤖 Co-authored by [Claudius the Magnificent](https://github.com/lklimek/claudius) AI Agent</sub> Co-Authored-By: Codex GPT-6 <[email protected]>
Serialize contact-info writes across UI surfaces and preserve visibility in note-only updates. Carry owner/contact correlation through initialization, join and bare task failures. Keep confirmed notes across stale reloads until observed, and estimate fees using the encrypted payload limit. Clarify offline memo behavior and cover long usernames in narrow Home layouts. Validation: 164 targeted tests passed; scoped Clippy, formatter and four CLI smoke checks passed. Native desktop checks covered long usernames in light and dark themes with isolated synthetic data. No transactions submitted. <sub>🤖 Co-authored by [Claudius the Magnificent](https://github.com/lklimek/claudius) AI Agent</sub> Co-Authored-By: Codex GPT-6 <[email protected]>
Keep contact-info guards until task completion, serialize request-action reads and decisions with writes, reject nonzero padding, and restore hidden contacts after failed unhide operations. Validated with 116 targeted unit/UI tests, scoped Clippy and formatting. <sub>🤖 Co-authored by [Claudius the Magnificent](https://github.com/lklimek/claudius) AI Agent</sub> Co-Authored-By: Codex GPT-6 <[email protected]>
The base merge kept the hidden-hub error route's new owner-aware shape but dropped the hub's context-keyed release, so a bare error on a contact details write sent while another screen covered the hub left its saving guard stuck. Pass the context through again and release the write it names. Also adapt the kittest helper to the base's `TaskResult` delivery API. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contact details (nickname, note, hidden) are now written and read through platform-wallet's DIP-15 contactInfo support, so other DashPay clients can read them. DET supplies only the seal/open step via a ContactCryptoProvider that borrows the seed from the secret seam for one operation; the child keys come from platform-wallet's derive_contact_info_keys. - Writes go through set_contact_info_with_external_signer; DET checks the wallet identity index and the established contact first. Until the identity has two contacts the details stay on this device and the UI says so. - Reads prefer platform-wallet's synced details; documents written by older DET versions show only as a fallback, newest document wins. - Declining a request ignores the sender in platform-wallet and records the decline; withdrawing records the withdrawal. Neither writes contactInfo. - Removed the unreadable-details overwrite prompts, per-request hide journal, and preserved accepted accounts, which no longer apply. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
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: trueWalkthrough
Merge Risk:
|
|
🕓 Review not started yet because this PR is a draft.
Commit 932aac8. Normal review starts when eligible; priority review starts as soon as a slot is available. |
- Withdrawing a contact request also ignores the recipient in platform-wallet, and the contacts list leaves out anyone whose request was withdrawn. A later reply shows as a new request to answer instead of turning into a contact on its own. - Once platform-wallet has held a contact's details, a legacy-key contactInfo document no longer stands in for them, even when they are empty. A cleared note or an unhide is not undone by the old document, and the next save does not publish it again. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Wallets load without their seed after a restart, and platform-wallet then only queues the contactInfo decrypt for a host drain that also runs unrelated contact-account jobs. DET now opens the owner's DIP-15 contactInfo documents itself with platform-wallet's keys and codec, in one secret session, through the same ContactCryptoProvider. Documents that do not open are skipped. A published document is the latest state from any device, so it wins over this device's details and over legacy ones, both in the list and as the base a save keeps. Saving on one device no longer reverts a hidden flag or note set on another. A published document, even an empty one, also counts as synced, so details cleared on another device stay cleared. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Another screen can write the same contact while the hub's note save or unhide waits behind it on the per-identity lock. Its outcome reached the hub by owner and contact alone, which finished the hub's write, showed it as saved, and announced it before it ran. The hub now sends each direct contact details write under its own dispatch context and settles success, failure and the overwrite prompt only for that dispatch. Another screen's success just refreshes the list. Co-Authored-By: Claude Opus 5.5 <[email protected]>
TL;DR: Contact nicknames, notes and hidden flags are now saved and read in the standard DashPay format through the shared wallet library, so other DashPay apps can read what Dash Evo Tool saves and the other way round. Contact QR codes now follow the same standard: the invite key comes from your recovery phrase, and the code names your username.
User story
As a DashPay user, I want the nicknames and notes I give my contacts to be readable by any DashPay wallet I restore with the same recovery phrase, so that my contact details are not locked to one app.
Scenario
Base flow
A user opens a contact in the identity hub or on the Contact Details screen, adds a nickname or a private note, and saves.
Actual behavior
Dash Evo Tool encrypts contact details with a key that no other DashPay client derives. Other wallets cannot read them, and Dash Evo Tool cannot read details those wallets saved. Declining or withdrawing a contact request also publishes a hidden-contact record, which reveals publicly that you ignored someone.
Expected behavior
Detailed discussion
Writes.
create_or_update_contact_infoholds the per-identity lock and runs platform-wallet'ssync_contact_infosfirst; a failed sync aborts the write. It resolves the per-field update against the details currently shown, which come from platform-wallet or else from a legacy document.TaskError::DashPayContactDetailsUnreadable, and nothing is written. The details count as unreadable when the published document did not open, or when an unreadable legacy document is the one shown.It validates the note and checks the size with
encode_private_data_bounded, then callsWalletBackend::dashpay_set_contact_info. That method checks the identity's wallet index (TaskError::ContactInfoIdentityNotFromWallet) and the established contact (TaskError::ContactInfoContactNotEstablished). It then callsDashPayView::set_contact_info_with_external_signerinside one HD-seed secret session, withQualifiedIdentityas the signer and a hostContactCryptoProvider(src/wallet_backend/contact_info.rs).Provider. Only seal and open are implemented. Keys come from platform-wallet's
derive_contact_info_keys, and the AES steps fromplatform-encryption, which is added as a direct dependency at the same pinned revision. Any root path other than the identity's own authentication path is refused. The other six trait methods returnPlatformWalletError::InvalidParameter.Publish outcomes. A failed publish records nothing. platform-wallet stores the details on this device before it publishes them, but its error does not say whether it got that far.
Publishedis reported as a success.DeferredUntilTwoContactsshows an info banner.SkippedWatchOnlymaps to the wallet-index error; the index is checked before the call, so this should not happen.Reads.
load_contactsrunsdashpay_sync, thensync_contact_infos(best effort). The contactInfo documents are fetched once, in order of$updatedAt, and read two ways.WalletBackend::dashpay_open_contact_infosopens the DIP-15 documents in one HD-seed session throughContactInfoCryptoand platform-wallet'sderive_contact_info_keysanddecode_private_data. The newest document per contact wins, and documents that cannot be opened are skipped. This covers wallets that platform-wallet loads without their seed after a restart, wheresync_contact_infosonly queues the decrypt. The upstream drain is not used, because it also runs the contact payment-account jobs.det:dashpay:details_synced:is unset. Any successful save sets that marker, and so does a published document, even an empty one. Saves follow the same precedence for the fields they keep.account_referencestill comes from the legacy read.Decline and withdraw. Decline calls
ignore_contact_senderand recordsmark_declined. Withdraw also callsignore_contact_senderand recordsmark_withdrawn. Neither writes contactInfo.WalletBackend::dashpay_disengaged_fromapplies this rule inload_contacts, andpending_requestsapplies it in the request lists. The declined incoming request stays hidden, and the owner's own sent request stays listed.unignore_contact_senderand clears both markers. When the owner's request already exists on Platform, sending or accepting again restores it without publishing.Removed (added by #1096, no longer needed):
UnreadableContactInfoPolicyandTaskError::DashPayContactInfoRead;acceptedAccountson update;Contact QR codes (DIP-15 auto-accept)
m/9'/coin'/16'/expiry', and the secret seam lends the seed once (with_secret_session(SecretScope::HdSeed)). Before, DET used the identity's ENCRYPTION key as if it were the seed, so its codes did not follow DIP-15 and exposed that key.DashPayView::build_auto_accept_qrbuilds it (wallet_backend/auto_accept.rs), through a narrowContactCryptoProvider,AutoAcceptKeyExport.m/9'/coin'/16'/x'with a hardened leaf, and no expiry later than now + 1 h + 300 s of clock skew. Refusals are typed (AutoAcceptKeyRefusal).dash:?du=<username>&dapk=…per DIP-15. It replaces DET's non-standarddi=<identity id>, and validity is fixed at 1 h (upstreamAUTO_ACCEPT_TTL_SECS). The validity and account-index fields are removed.model::dashpay_contact_qr::ContactQrCodeparses with platform-wallet's codec and requiresduto be a valid DPNS label. Expiry is checked before sending. TheautoAcceptProofis signed withsign_auto_accept_proofover the request's finalaccountReference, and the recipient is<du>.dash. The account label "QR Contact (Account #n)" is no longer sent.ContactQrUrihas a redactedDebug, so the key never reaches logs.auto_accept_proof.rs),derive_auto_accept_key, the unusedauto_accept_handler.rsand the stringly-typedInvalidQrCode.Known limitations
drain_pending_contact_crypto_verified, TODO inWalletBackend::dashpay_sync). This is a follow-up.acceptedAccounts, because platform-wallet always writes an empty list. Multi-account support is deferred upstream (DashPay backlog (post-M1) — migrated from docs/dashpay/TODO.md platform#4020).Testing
dashpay,contact,backend_task::error): 490 passed. They include provider tests that check interop with platform-wallet's seal and open, and tests for the unreadable-details refusal, the failed publish, the decline rule and per-person locking.identity_hub: 72 passed.cargo clippy --all-features --all-targets -- -D warningsis clean.accountReferencefails;di=codes, and usernames with bidi, zero-width or control characters or with the wrong length, are refused;Debug.🤖 Co-authored by Claudius the Magnificent AI Agent
🤖 Generated with Claude Code
https://claude.ai/code/session_012ujJpB9DBhvtbjhYB3aG9Q
Summary by CodeRabbit