Skip to content

fix(dashpay): keep the unfinished top-up predicate type-checkable on Xcode 26 - #1198

Merged
romchornyi merged 3 commits into
developfrom
fix/1197-predicate-typecheck
Oct 8, 2026
Merged

romchornyi merged 3 commits into
developfrom
fix/1197-predicate-typecheck

Conversation

@romchornyi

@romchornyi romchornyi commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Issue being fixed or feature implemented

develop does not archive on Xcode 26.6, which is what the TestFlight workflow builds with. The #Predicate in DWIdentityRegistrationCoordinator.hasUnfinishedIdentityTopUp (added with #1141) fails with "the compiler is unable to type-check this expression in reasonable time". The 9.1.3 release-candidate run from develop stopped there: https://github.com/dashpay/dashwallet-ios/actions/runs/37793268497

Closes #1197

What was done?

  • The asset-lock fetch uses the SDK's PersistentAssetLock.predicate(walletId:) instead of a compound inline #Predicate.
  • The status (Broadcast…ChainLocked) and funding-type conditions moved into the Swift filter that already ran on the fetched rows. The result is the same for every status / funding-type combination.
  • The pending status range is named through AssetLockStatus.

Not changed, present before this PR: a failed fetch still returns false (try?), and an identity whose row is not found still matches a top-up lock of any identity in the wallet.

How Has This Been Tested?

Breaking Changes

None.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Identity setup now more accurately recognizes pending top-ups that can be used for registration. Eligible top-ups include those not yet linked to an identity or those linked to the requested identity; when no identity is specified, any eligible linked top-up is recognized. Top-ups outside the pending confirmation stages or used for other funding purposes are not treated as eligible.

jeanpierreroma and others added 3 commits October 8, 2026 18:42
…Xcode 26

The compound #Predicate in hasUnfinishedIdentityTopUp fails with "unable to
type-check this expression in reasonable time" on Xcode 26.6, which is what
the TestFlight workflow builds with. Fetch by wallet only and apply the
status and funding-type conditions in Swift; the result is unchanged.

Closes #1197

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…d only the fields read

Review follow-up: reuse PersistentAssetLock.predicate(walletId:), limit the
fetch to the three fields the filter reads, and name the raw discriminants.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…us; drop propertiesToFetch

The asset-lock table is tiny and propertiesToFetch does not spare the object.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b6c5a241-81c3-4ac3-a6b6-24ce8e76868f
📥 Commits

Reviewing files that changed from the base of the PR and between 91fe039 and 61573a4.

📒 Files selected for processing (1)
  • DashWallet/Sources/Infrastructure/SwiftDashSDK/Identity/DWIdentityRegistrationCoordinator.swift

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The identity top-up check now fetches asset-lock rows with a wallet-only predicate. It applies funding type, status, and identity-index checks in Swift.

Changes

Identity top-up check

Layer / File(s) Summary
Fetch and filter identity top-ups
DashWallet/Sources/Infrastructure/SwiftDashSDK/Identity/DWIdentityRegistrationCoordinator.swift
The function uses PersistentAssetLock.predicate(walletId:) to fetch rows, then filters them by funding type, status, and identity index. Unbound top-ups match any identity. Bound top-ups match the requested index, or any index when the requested index is unavailable.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: jeanpierreroma

Merge Risk: ⚪ Minimal · up to 61573

Status, funding-type, and identity checks now run in Swift after the fetch, and the implicated compound predicate is gone. No specific merge-blocking failure is established, though the SDK predicate implementation and a successful Xcode 26.6 archive were unavailable for confirmation.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: updating the unfinished top-up predicate so it remains type-checkable on Xcode 26.
Linked Issues check ✅ Passed The PR addresses the coding requirement in #1197. It replaces the compound inline #Predicate in DWIdentityRegistrationCoordinator.hasUnfinishedIdentityTopUp with `PersistentAssetLock.predicate(wal…
Out of Scope Changes check ✅ Passed The whole-PR summary identifies changes only in DWIdentityRegistrationCoordinator.swift. The changes are limited to the predicate and its existing post-fetch filtering for the build issue in #1197. …
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@thepastaclaw

thepastaclaw commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

✅ Final review complete — no blockers (commit 61573a4) · triage: low

@llbartekll llbartekll left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Built the PR head (61573a4) locally with Xcode 26.6 (17F113), dashpay scheme, arm64 simulator, against platform c83c2c05e7: BUILD SUCCEEDED, so the #Predicate type-check failure from #1197 is gone on the toolchain TestFlight uses.

Checked the filter against the old inline predicate: status 1...3 via the app's AssetLockStatus (broadcast=1 … chainLocked=3, Int raw), funding type 1 (identityTopUp, matched against the identity's index or any when unknown) and 2 (identityTopUpNotBound, always matches), everything else excluded. Same result for every status / funding-type combination; PersistentAssetLock.predicate(walletId:) is the SDK's indexed per-wallet scan. Both callers in CreateUsernameViewModel are unchanged.

@thepastaclaw thepastaclaw 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.

Final validation — Phase 1 + Phase 2

The wallet-scoped SDK fetch and subsequent Swift filtering preserve the original pending-status, funding-type, and identity-matching conditions; static inspection found no introduced defects. Exact-head title and accessibility checks passed in the supplied CI snapshot. Xcode 26.6 archive validation remains unconfirmed: the cited TestFlight run is still in progress and reports the base SHA rather than the reviewed head.

Review provenance

Source: reviewer 1: gemini-3.8-flash-high (agent: phase1-reviewer, role: general); reviewer 2: gpt-6.1-sol (agent: phase2-reviewer, role: general); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)

  • Triage: low by gpt-6.1-sol (effort low) — This small, single-function change replaces a compound SwiftData predicate with a wallet predicate and equivalent in-memory filtering to avoid a compiler type-checking failure.
  • Phase 1 reviewers: gemini-3.8-flash-high — general (completed, effort high); agent phase1-reviewer
  • Phase 1 model: gemini-3.8-flash-high — antigravity quota: weekly 96% left, 5h 83% left
  • Fresh verifier: gpt-6.1-sol — final-verifier; agent sol-verifier
  • Phase 2 reviewers: gpt-6.1-sol — general (completed, effort medium); agent phase2-reviewer

@romchornyi
romchornyi merged commit 37c0e78 into develop Oct 8, 2026
4 checks passed
@romchornyi
romchornyi deleted the fix/1197-predicate-typecheck branch October 8, 2026 16:24
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.

#Predicate in hasUnfinishedIdentityTopUp fails to type-check on Xcode 26.6

4 participants