Skip to content

fix(swift-sdk): fix dash-spv sync (somehow)#3404

Open
ZocoLini wants to merge 1 commit intov3.1-devfrom
fix/dash-spv-sync
Open

fix(swift-sdk): fix dash-spv sync (somehow)#3404
ZocoLini wants to merge 1 commit intov3.1-devfrom
fix/dash-spv-sync

Conversation

@ZocoLini
Copy link
Copy Markdown
Collaborator

@ZocoLini ZocoLini commented Mar 25, 2026

Somehow this Pr makes dash-spv work in my machine after clearing the simulator with the changes this PR introduce, I didn't do a deep research on why, I will be investigating tomorrow, I have a little theory and has too do with file permissions and the way FileManager creates directories vs how Rust does. The reason I think thats the issue its bcs sync was working fine for me until I cleared the storage, then it got stuck until I removed the file creation and created a new simulator, letting dash-spv manage the directory creation

Summary by CodeRabbit

  • Refactor
    • Synchronization method execution changed from asynchronous to synchronous throughout the SDK, altering how wallet initialization and data syncing are handled in client applications.

@github-actions github-actions bot added this to the v3.1.0 milestone Mar 25, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 25, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f43086f1-c23f-4990-afb6-6d0cbdd2bffa

📥 Commits

Reviewing files that changed from the base of the PR and between 89a1036 and 9f8ec47.

📒 Files selected for processing (3)
  • packages/swift-sdk/Sources/SwiftDashSDK/Core/SPV/SPVClient.swift
  • packages/swift-sdk/Sources/SwiftDashSDK/Core/Services/WalletService.swift
  • packages/swift-sdk/SwiftExampleApp/SwiftExampleApp/Core/Views/CoreContentView.swift

📝 Walkthrough

Walkthrough

The changes convert the SPV synchronization flow from asynchronous to synchronous across the SDK stack, removing the async keyword from SPVClient.startSync() and WalletService.startSync(). Additionally, conditional directory-creation logic for the SPV data directory is removed from wallet service initialization, and call sites are updated to match the new synchronous method signatures.

Changes

Cohort / File(s) Summary
Synchronization API Refactoring
packages/swift-sdk/Sources/SwiftDashSDK/Core/SPV/SPVClient.swift, packages/swift-sdk/Sources/SwiftDashSDK/Core/Services/WalletService.swift
Removed async keyword from startSync() methods in both SPVClient and WalletService. Eliminated conditional directory creation for SPV data directory during initialization. Updated internal call from try await to try to match synchronous API.
View Layer Integration
packages/swift-sdk/SwiftExampleApp/SwiftExampleApp/Core/Views/CoreContentView.swift
Updated call to walletService.startSync() from async Task pattern to direct synchronous method call.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Poem

🐰 No more async hops, we hop it straight,
A synchronous path without the wait,
The wallet syncs with vigor true,
Swift and simple, through and through! ✨

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 38.46% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'fix(swift-sdk): fix dash-spv sync (somehow)' is vague and lacks specificity about what the actual fix is, using the non-descriptive phrase '(somehow)' that doesn't convey meaningful information about the changes. Revise the title to be more specific about the actual changes made, such as 'fix(swift-sdk): remove directory creation logic from WalletService and make startSync synchronous' or similar, to clearly describe the actual fix being implemented.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/dash-spv-sync

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 and usage tips.

@github-actions
Copy link
Copy Markdown
Contributor

✅ DashSDKFFI.xcframework built for this PR.

SwiftPM (host the zip at a stable URL, then use):

.binaryTarget(
  name: "DashSDKFFI",
  url: "https://your.cdn.example/DashSDKFFI.xcframework.zip",
  checksum: "b39568ccda12ade1b4e01ca85d7fff12b135b0ce9e99c8fd10526a619b329d55"
)

Xcode manual integration:

  • Download 'DashSDKFFI.xcframework' artifact from the run link above.
  • Drag it into your app target (Frameworks, Libraries & Embedded Content) and set Embed & Sign.
  • If using the Swift wrapper package, point its binaryTarget to the xcframework location or add the package and place the xcframework at the expected path.

@shumkov
Copy link
Copy Markdown
Collaborator

shumkov commented Mar 26, 2026

Heya! I need recent version of dashcore here #3405. I guess it affect what you are doing here

Copy link
Copy Markdown
Collaborator

@thepastaclaw thepastaclaw left a comment

Choose a reason for hiding this comment

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

Code Review

Neither proposed finding is verified against the source. The startSync signature change is not a proven source-breaking compile failure in Swift, and the SPV directory regression is only a suspicion because the native FFI directory-creation behavior is not present in this repo for verification.

Reviewed commit: 9f8ec47

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.

3 participants