Skip to content

platform-wallet: a host cannot tell an own DashPay profile that is absent from one that failed to fetch #6187

Backlog

Description

@QuantumExplorer

Problem

DashPayView::sync_profiles (packages/rs-platform-wallet/src/wallet/identity/network/profile.rs) logs a failed own-profile fetch and returns Ok(0). After that call returns, an identity with no cached profile can be in one of two states:

  • Platform has no profile document. A profile write must create one.
  • The fetch failed. Platform may hold a profile, and a create would be rejected as a duplicate.

The FFI and the hosts can't tell these apart. platform_wallet_get_dashpay_profile returns "absent" in both cases, and the persister treats an absent own profile as "no update", so a profile deleted on Platform also leaves its last row in the host's storage.

There is a second problem with how the cache is written. sync_profiles fetches before it takes the wallet write lock. It then stores the fetched profile whenever it differs from the cached one, without checking which read is newer. Two overlapping syncs can therefore store an older read over a newer one.

Effect on hosts

The Android profile editor (#6146) has to decide between create and update from the wallet's in-memory profile. It now treats a miss as "absent" only after a completed DashPay sync pass, and it no longer runs a sync of its own. The remaining gap is a pass whose fetch failed: the screen then offers Create while Platform may still have the profile. SwiftExampleApp has the same gap: its editor creates whenever the cached profile is missing.

What would close it

  • An identity-scoped own-profile check that returns "found", "confirmed absent" or "failed", carried through the FFI. Optionally, it could record a confirmed absence so the persister can clear the host's row.
  • Make a stored own profile monotonic: a sync must not replace the cached profile with a read older than the one it holds.

Raised in review of #6146 (#6146 (comment)).

Activity

  1. QuantumExplorer commented on Nov 23, 2026

    @QuantumExplorer
    MemberAuthor

    More cases from the #6146 review (#6146 (comment)), all caused by the same missing per-identity result:

    • An identity added after a pass started is not in that pass. For example, one recovered through Search Wallets for Identities. sync_profiles queries only the identity ids it collected at the start of the pass, so the manager-wide last_sync time says nothing about any one identity.
    • A pass that finds no profile writes nothing. No cache change and no persister row, so a host waiting for a change never sees an answer.

    Kotlin works around this until the fix lands. It counts a miss as "no profile" only after a pass that started after the screen opened, which it detects by last_sync advancing twice. It polls until then, and Save re-reads the cache right before a create.

    What would remove the workaround: an identity-scoped result of the coordinated sync (found, confirmed absent, or failed, with the pass or check time), readable through the FFI, that is also recorded when nothing changed.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions