Skip to content

platform-wallet: contactInfo update rewrites the oldest of a contact's documents, while sync shows the newest #5544

Open

Description

@Claudius-Maginificent

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)

  1. Create two contactInfo documents owned by identity A whose encToUserId opens to contact B, one older and one newer.
  2. Call set_contact_info_with_external_signer(A, B, Some("new alias"), ..).
  3. Call sync_contact_infos().
  4. 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

Detailed discussion

All references are to packages/rs-platform-wallet/src/wallet/identity/network/contact_info.rs at 9f7ed16:

  • fetch_contact_info_docs orders by $updatedAt ascending (around line 126).
  • sync_contact_infos applies the decrypted documents in that order through set_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_signer breaks on the first document whose encToUserId opens 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

🤖 Co-authored by Claudius the Magnificent AI Agent

Activity

  1. added
    bug
    on Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions