You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
An own-profile refresh that started before a profile write can overwrite it in the wallet's cache #6165
DashPayView::sync_profiles (packages/rs-platform-wallet/src/wallet/identity/network/profile.rs) fetches the wallet identities' profiles, then takes the wallet lock and stores every fetched profile that differs from the cached one.
A profile write (write_dashpay_profile) stores the profile Platform proved for the write. Nothing orders the two:
A background refresh fetches the profile and reads the document as it was before the write.
The write lands and the wallet caches the new profile.
The refresh takes the lock, sees its (older) result differs from the cache, and stores it.
The cache and the host's persisted row now hold the profile from before the write, until a later refresh succeeds. Any field can be affected. It matters most for a payment address: one the user just removed shows as published again, or a replaced one shows its old value.
The lock serializes the two assignments but says nothing about which read is newer.
Possible fix
Keep, per identity, the proved height (or the document revision) of the profile the cache holds, and have the refresh skip a result that is older than what the cache holds. The profile document's $revision is already in both the fetched document and the write's result, so comparing revisions needs no new query.
A test: a refresh paused after its fetch, a confirmed write that removes a field while another remains, then the refresh released; the cache must keep the written profile.
This predates profile payment addresses. Raised by the review of #6094: #6094 (comment)
Activity