Skip to content

feat(syncing): per-phase progress, connected peers, and peer rotation in the sync alert - #809

Merged
QuantumExplorer merged 1 commit into
swift-sdk-integrationfrom
fix/sync-dialog-all-phases
Jul 16, 2026
Merged

QuantumExplorer merged 1 commit into
swift-sdk-integrationfrom
fix/sync-dialog-all-phases

Conversation

@QuantumExplorer

Copy link
Copy Markdown
Member

What

The syncing detail alert used to show one header #x of x line even when headers were finished and the overall percentage was actually grinding through the filter phases. This PR makes the dialog explain the whole pipeline and gives users a self-serve action when sync drags:

  • Per-phase progress: SyncStateSnapshot now carries a phase array (headers → filter headers → filters → masternode list) populated from SPVSyncProgress; the alert renders one row per phase with its own progress bar, a green ✓ once caught up, and grouped heights (1,754,000 / 2,505,629).
  • SwiftUI rewrite: the alert content is a new SyncingAlertView (+ view model observing SyncingActivityMonitor and the SPV coordinator); the UIKit SyncingAlertContentView is deleted and SyncingAlertViewController shrinks to the modal-popup hosting shell — per the SwiftUI-first rule.
  • Connected peers: live list from SwiftDashSDKSPVCoordinator.connectedPeers with node-type badges (Evonode / Masternode / Node) and a count.
  • "Sync too slow? Change peers": appears after 45 s without progress movement, hides while an identity registration/claim is in flight (asset-lock IS/CL proofs ride the P2P subscription). Tapping calls the new SwiftDashSDKWalletRuntime.rotatePeers() — a peerRotation refresh trigger through the runtime's serialized lifecycle pipeline (full stop → start; dash-spv re-dials from DNS seeds and resumes from persisted chain data).

Known limitation, documented in code: peer selection on restart is seed-random, so redialing a previous peer is possible. A guaranteed fresh set needs an exclude-list on PlatformSpvStartConfig upstream.

Five new en localization keys (Connected peers, Sync too slow?, Change peers, Evonode, Node) plus three phase labels; Masternode and Filters reuse existing translated keys.

Verification

  • dashpay arm64-sim build green (Xcode 26.6 / Swift 6.3.3).
  • QA-simulator smoke mid-sync on a recovered testnet wallet: dialog shows headers ✓ and masternode list ✓ with filter header / filter rows advancing; peer rows render with type badges.

🤖 Generated with Claude Code

… in the sync alert

The syncing detail alert previously showed a single "header #x of x"
line even when headers were long finished and the overall percentage was
grinding through the filter phases. It now renders the whole pipeline:

- SyncStateSnapshot carries a per-phase array (headers, filter headers,
  filters, masternode list) populated from SPVSyncProgress; the alert
  shows one row per phase with its own progress bar, a green check once
  caught up, and grouping-formatted heights.
- The alert content is rewritten in SwiftUI (SyncingAlertView + view
  model observing the sync monitor and the SPV coordinator); the old
  UIKit SyncingAlertContentView is deleted and the controller shrinks
  to the modal-popup hosting shell.
- Connected peers are listed live from
  SwiftDashSDKSPVCoordinator.connectedPeers with node-type badges
  (Evonode / Masternode / Node).
- "Sync too slow? Change peers" appears after 45 s without progress
  movement and triggers SwiftDashSDKWalletRuntime.rotatePeers() — a new
  serialized full stop → start through the runtime's lifecycle pipeline;
  dash-spv re-dials peers from the DNS seeds and resumes from persisted
  chain data. The action hides while an identity registration/claim is
  in flight (asset-lock IS/CL proofs ride the P2P subscription). Peer
  selection is seed-random — a same-peer redial is possible until the
  SDK grows an exclude-list.

Verified: dashpay arm64-sim build green; QA-simulator smoke of the
mid-sync dialog (headers/masternodes checked, filter phases advancing).

Co-Authored-By: Claude Fable 5 <[email protected]>
@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: 29a855bc-3b1b-48ff-a6b0-edc8a0a12d85

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/sync-dialog-all-phases

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 4c85498 into swift-sdk-integration Jul 16, 2026
1 check passed
@QuantumExplorer
QuantumExplorer deleted the fix/sync-dialog-all-phases branch August 7, 2026 08:23
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