Skip to content

fix(dashpay): write contact alias/note/hidden through setDashPayContactInfo#834

Merged
QuantumExplorer merged 1 commit into
swift-sdk-integrationfrom
fix/contact-meta-real-write
Jul 16, 2026
Merged

fix(dashpay): write contact alias/note/hidden through setDashPayContactInfo#834
QuantumExplorer merged 1 commit into
swift-sdk-integrationfrom
fix/contact-meta-real-write

Conversation

@QuantumExplorer

Copy link
Copy Markdown
Member

Summary

Saving a contact's alias/note (or hiding a contact) was a complete no-op behind a "Saved" toast. QA evidence: after saving an alias, the contactAlias/contactNote mirror columns in SwiftData stayed empty.

Root cause (SDK-side): the sheet was wired to EstablishedContact.setAlias/setNote/hide, which mutate a detached FFI clonemanaged_identity_get_established_contact inserts a .cloned() copy into the handle table, so the mutation never reaches the wallet manager's contact state, is never persisted, and is lost when the handle is freed. (The earlier resync-retry fix on this path cured the lookup failure but couldn't cure the phantom write.)

Fix: rewire to the SDK's real write path — ManagedPlatformWallet.setDashPayContactInfoset_contact_info_with_external_signer, which:

  1. updates the wallet manager's real contact state (local first, works offline),
  2. persists it — feeding the SwiftData mirror that the contacts list, payment-row aliases, and storage explorer read,
  3. publishes the self-encrypted DIP-15 contactInfo document so alias/note/hidden roam across devices (outcome: published / deferred-until-2-contacts / skipped-watch-only).

Changes:

  • One combined setContactMeta(alias:note:hidden:for:) replaces the three per-field setters (the document carries all three together; the sheet sends its full current state on every save).
  • Now PIN/biometric-gated — the publish signs a Platform document with the identity key, same as every other document write. A cancelled prompt is silent, not an error alert.
  • The clone-mutating path (mutateEstablishedContact + resync-retry) is deleted.

Companion: platform#4140 deprecates the clone setters SDK-side so they can't be re-wired.

Test plan

  • Clean dashpay simulator build (arm64); installed on QA-iPhone16
  • Set an alias on a contact → PIN prompt → Saved; contactAlias mirror column non-empty (storage explorer → Contact Requests → detail) and payment rows read "Sent to "
  • Relaunch → alias survives
  • Hide/unhide round-trips

🤖 Generated with Claude Code

…ctInfo

The contact-settings sheet saved alias/note/hidden via the SDK's
EstablishedContact handle setters — which mutate a DETACHED FFI clone
(managed_identity_get_established_contact inserts a .cloned() copy into
the handle table). Nothing ever reached the wallet manager's contact
state, SwiftData, or Platform: the "Saved" toast covered a complete
no-op, which is why the QA sim's contactAlias/contactNote mirror
columns stayed empty after saving.

Rewire to the SDK's real write path, ManagedPlatformWallet
.setDashPayContactInfo — one combined alias+note+hidden write that
updates real wallet state, persists (feeding the SwiftData mirror the
contacts list, payment-row aliases, and storage explorer read), and
publishes the self-encrypted DIP-15 contactInfo document so the
metadata roams across devices ("remote wins" convergence). The publish
signs a Platform document with the identity key, so the write is now
PIN/biometric-gated like every other document write; a cancelled
prompt stays silent. The sheet sends its full current state on every
save (the document carries all three fields together).

The clone-mutating path (setAlias/setNote/setHidden +
mutateEstablishedContact and its resync-retry) is deleted; the setters
are deprecated SDK-side in platform PR #4140.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: fcc85870-bc88-4367-b279-e8d18b89a8f8

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/contact-meta-real-write

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@QuantumExplorer
QuantumExplorer merged commit 1f195c6 into swift-sdk-integration Jul 16, 2026
2 checks passed
QuantumExplorer added a commit that referenced this pull request Jul 16, 2026
Verified 2026-07-17 (dashpay arm64-sim green at app tip 1f195c6):
picks up platform #4139 (partial-amount withdrawal wrapper — the last
app-required surface that lived only on a local sidecar branch) and
#4140 (EstablishedContact clone-setter removal, requiring app tip >=
#834's setDashPayContactInfo rewire). The v4.1-dev-local sidecar branch
is retired alongside the long-gone integration branch.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant