Repository navigation
Description
TL;DR: When one DashPay contact has more than one saved "contact details" record, editing the nickname or note changes the oldest record, but the wallet displays the newest one, so the edit disappears after the next sync.
User story
As a DashPay user with more than one device or wallet app, I want my edits to a contact's nickname, note or hidden flag to stay in place after the wallet syncs, so that I do not lose changes I just made.
Scenario
Base flow
A contact ends up with two contactInfo documents. This happens when two devices each create one before either has synced, or when an older client cannot open a newer document and creates its own. The user then edits that contact's nickname or note.
Actual behavior
The save rewrites the older document. On the next sync_contact_infos, the newer, unchanged document is applied last and overwrites local state, so the user's edit is no longer shown.
Expected behavior
The save updates the same document that sync displays, the one with the greatest $updatedAt. The edit survives the next sync.
Expected Behavior
See "Expected behavior" above.
Current Behavior
See "Actual behavior" above.
Possible Solution
In set_contact_info_with_external_signer, pick the matching document with the greatest $updatedAt. Since documents arrive in ascending order, that means keeping the last match instead of breaking on the first.
Steps to Reproduce (for bugs)
- Create two
contactInfodocuments owned by identity A whoseencToUserIdopens to contact B, one older and one newer. - Call
set_contact_info_with_external_signer(A, B, Some("new alias"), ..). - Call
sync_contact_infos(). - B's alias is the newer document's old value, not
"new alias".
Context
Dash Evo Tool is moving its contact details (alias, note, hidden) onto DashPayView::set_contact_info_with_external_signer and sync_contact_infos.
Your Environment
- Version used:
rs-platform-walletat9f7ed16935bd540e4c2a542688800d2953f9f67a. The same code is onv5.0-devandv5.1-devas of 2026-10-22. - Link to your project: https://github.com/dashpay/dash-evo-tool
Detailed discussion
All references are to packages/rs-platform-wallet/src/wallet/identity/network/contact_info.rs at 9f7ed16:
fetch_contact_info_docsorders by$updatedAtascending (around line 126).sync_contact_infosapplies the decrypted documents in that order throughset_contact_metadata(around line 346), so the newest document is applied last and wins. This matches the doc comment's "convergence is last-writer through Platform".set_contact_info_with_external_signerbreaks on the first document whoseencToUserIdopens to the contact (around line 657), so it updates the oldest one. That contradicts the last-writer convergence above.
Acceptance: given two documents that open to the same contact, one older and one newer, the update targets the newer document id, and a following sync_contact_infos applies the saved values.
Prior work
- DashPay backlog (post-M1) — migrated from docs/dashpay/TODO.md #4020, the DashPay backlog: covers contactInfo pagination, the codec and the privacy of ignore. It does not cover how an update picks among several documents for one contact.
🤖 Co-authored by Claudius the Magnificent AI Agent
Activity