Skip to content

fix(contacts): offer only registerable networks in add address flow - #21470

Draft
claudiiafg wants to merge 1 commit into
developfrom
fix/LIVE-36688_continue
Draft

fix(contacts): offer only registerable networks in add address flow#21470
claudiiafg wants to merge 1 commit into
developfrom
fix/LIVE-36688_continue

Conversation

@claudiiafg

@claudiiafg claudiiafg commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

📝 Description

Adding an address to a contact could dead-end: entering a name and tapping Continue did nothing — no device prompt, no error, no way forward.

Previous behaviour

The network picker and the device hand-off disagreed about which networks are supported:

  • resolveEligibleAddressCurrencyIds offered every network in an eligible family (evm by default).
  • resolveContactDeviceContext only accepts networks whose Ledger coin app the Contacts kit knows (Ethereum and Tron).

23 EVM networks fall in that gap — mostly dead legacy chains, but also Ethereum Classic, Sonic and Sei. Picking one threw UnsupportedContactDeviceCurrencyError while building the operation, i.e. before the intent existed, so setActiveIntent never fired, the Device Intent Executor never mounted, and the throw was swallowed by the console.warn catch in useContactDetailScreenViewModel.

Fix

resolveEligibleAddressCurrencyIds now also gates on device support, so a network can only be offered if the flow can actually reach a signature on it. The supported-app check in resolveContactDeviceContext is extracted into an exported isContactDeviceCurrencySupported predicate rather than duplicated.

selectableNetworkIds disables rather than hides, so the affected networks stay visible and greyed out and tapping one shows the existing Contacts explanation ("… isn't supported yet") instead of a button that silently does nothing. Desktop shares the resolver, so it gets the same fix through its built-in tooltip.

Regression check

resolveEligibleAddressCurrencyIds.web.test.ts asserts the invariant directly — every network the picker offers must resolve a device context — so a newly added EVM network with its own coin app fails the suite instead of reaching users.

Note: a second cause of the same symptom, the add-address drawer holding the queued-bottom-sheet slot so the executor could never open, was fixed separately in 1c9242d.

🔗 Context

  • JIRA / GitHub issue: LIVE-36688
  • ADR (if any): n/a

@claudiiafg claudiiafg self-assigned this Sep 2, 2026
Copilot AI lite review requested due to automatic review settings September 2, 2026 20:29
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Web Tools Build Status

Build Status Deployment
Web Tools Build ⏭️ Skipped

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The change is narrowly scoped, aligns eligibility with device support, and includes targeted regression tests to prevent reintroducing the dead-end.

Pull request overview

This PR fixes a dead-end in the Contacts “add address” flow by ensuring the network picker only allows networks that can successfully resolve to a Contacts device context (i.e., the flow can reach a device signature).

Changes:

  • Gate resolveEligibleAddressCurrencyIds on device-supported coin apps via a shared predicate (isContactDeviceCurrencySupported).
  • Add regression tests asserting “every offered network must resolve a device context” and extend existing device-context tests to cover EVM networks with their own coin apps.
  • Update docs and selection-viewmodel tests to reflect the refined eligibility set (notably adding Tron and excluding unsupported networks like Ethereum Classic).
File summaries
File Description
features/platform/contacts/src/utils/resolveEligibleAddressCurrencyIds.web.test.ts Adds invariant test that all offered networks can resolve a device context; adjusts expected eligible networks.
features/platform/contacts/src/utils/resolveEligibleAddressCurrencyIds.ts Filters eligible networks by both family and device support (isContactDeviceCurrencySupported).
features/platform/contacts/src/device/resolveContactDeviceContext.ts Extracts currency support logic into findContactDeviceCurrency and exports isContactDeviceCurrencySupported.
features/platform/contacts/src/device/resolveContactDeviceContext.test.ts Adds coverage for rejecting EVM networks with their own coin app; adds tests for isContactDeviceCurrencySupported.
features/platform/contacts/README.md Documents that eligible networks are additionally constrained by device-registerable support.
features/flow/flow-contacts-add-address/src/state/useAddAddressCurrencySelectionViewModel.web.test.tsx Updates expectations for the eligible network list passed to the currency selection port.
.changeset/LIVE-36688-contacts-signable-networks.md Adds a changeset describing the user-facing fix across Desktop/Mobile and the contacts package.
Review details
  • Files reviewed: 7/7 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Rsdoctor Bundle Diff Analysis

Found 7 projects in monorepo, 2 projects with changes.

📊 Quick Summary
Project Total Size Gzip Size Change Gzip Change
desktop-main 2.5 MB - 0 -
desktop-preloader 7.1 KB - 0 -
desktop-renderer 82.4 MB - +79.0 B (0.0%) -
desktop-webviewDappPreloader 36.9 KB - ❓ 0 -
desktop-webviewPreloader 200.0 B - 0 -
desktop-workers 36.8 KB - 0 -
mobile 129.5 MB - +544.0 B (0.0%) -
📋 Detailed Reports (Click to expand)

📁 desktop-renderer

Path: rsdoctor/desktop-renderer/rsdoctor-data.json

📌 Baseline Commit: d80a0e0f653302623aa09406ab8ff0358546386b | PR: #21398

Metric Current Baseline Change
📊 Total Size 82.4 MB 82.4 MB +79.0 B (0.0%)
🗜️ Gzip Size - - -
📄 JavaScript 30.6 MB 30.6 MB +79.0 B (0.0%)
🎨 CSS 188.4 KB 188.4 KB 0
🌐 HTML 1.8 KB 1.8 KB 0
📁 Other Assets 51.7 MB 51.7 MB 0

📦 Download Diff Report: desktop-renderer Bundle Diff

📁 mobile

Path: rsdoctor/mobile/rsdoctor-data.json

📌 Baseline Commit: d80a0e0f653302623aa09406ab8ff0358546386b | PR: #21398

Metric Current Baseline Change
📊 Total Size 129.5 MB 129.5 MB +544.0 B (0.0%)
🗜️ Gzip Size - - -
📄 JavaScript 114.0 MB 114.0 MB +544.0 B (0.0%)
🎨 CSS 0 B 0 B 0
🌐 HTML 0 B 0 B 0
📁 Other Assets 15.5 MB 15.5 MB 0

📦 Download Diff Report: mobile Bundle Diff

Generated by Rsdoctor GitHub Action

@sonarqubecloud

sonarqubecloud Bot commented Sep 2, 2026

Copy link
Copy Markdown

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.

2 participants