Skip to content

fix(wallet): preserve consumed asset-lock reports with SQLite - #1036

Draft
lklimek wants to merge 4 commits into
fix/orphaned-txfrom
fix/asset-lock-reconciliation-report
Draft

lklimek wants to merge 4 commits into
fix/orphaned-txfrom
fix/asset-lock-reconciliation-report

Conversation

@lklimek

@lklimek lklimek commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

TL;DR

When a saved deposit is reported as already used, Fund now shows that result instead of an unrelated storage error or a generic retry suggestion.

User story

As a wallet user, I can understand why an old deposit cannot fund another payment and choose another deposit or check the earlier payment.

Scenario

In Wallets → Dash Core → Asset Locks, choose Fund for a restored deposit that Platform reports as already consumed. The recovery step previously failed with a missing storage capability, hiding the result. The app now retains the recovery record and shows an actionable already-used message. This does not make spent funds available again or prove that the requested payment succeeded.

Detailed discussion

Stacked on #1028 (fix/orphaned-tx), independently of the key-lookup fix in #1035.

  • Pin Platform to c0fd3b133bf37d0fc79dc8e55d8ad4b25aee662f from fix(wallet): require only atomic tracked-lock writes for reconciliation platform#5207. Reconciliation of an already-loaded asset lock requires only ATOMIC_CHANGESETS | TRACKED_ASSET_LOCKS. Existing capability meanings and FFI callback requirements remain unchanged; SQLite does not claim WALLET_RESTORE.
  • Map direct PlatformWalletError::AssetLockAlreadyConsumed to a dedicated TaskError preserving its source and explaining the result. SDK-originated consumed errors keep their existing classification.
  • Cargo.lock changes only the Platform revision. rust-dashcore remains 18f7f3e695e770ea5d2820aa85597d45160d1b8e.

Diagnosis used read-only snapshots of the reported user databases and logs. The logs show a matching already-consumed rejection followed by the misleading persistence-capability failure. A restored Core funding transaction alone does not establish that its Platform credits remain unused; no user records are deleted or marked conclusively consumed on that evidence.

Validation:

  • New mapping regression failed before the fix; all 6 targeted mapping tests passed with the final Platform pin.
  • Upstream fix passed 20 focused tests covering capabilities, real wallet hydration after reopening SQLite, typed consumption reports, and persistence failures.
  • cargo fmt --all -- --check, scoped Clippy (--locked --lib --all-features -- -D warnings), and git diff --check passed.
  • The upstream fix has no net Swift or FFI production changes. Full SQLite wallet restoration is separate follow-up work and is not included in this pin.
  • No live user-wallet spending was performed. Full workspace tests were not rerun locally. Draft PRs do not trigger automatic CI.

🤖 Co-authored by Claudius the Magnificent AI Agent

Pin the scoped asset-lock reconciliation fix and retain its typed consumed report in an actionable user message.

Co-Authored-By: OpenAI Codex <noreply@openai.com>
@coderabbitai

coderabbitai Bot commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

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 Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator

🕓 Review not started yet because this PR is a draft.

  • Request normal review — click when the PR is ready for review.
  • Request priority review — click to move this review to the front of the queue.

Commit 50847c4. Normal review starts when eligible; priority review starts as soon as a slot is available.

lklimek and others added 3 commits September 29, 2026 16:46
Co-Authored-By: OpenAI Codex <noreply@openai.com>
Co-Authored-By: OpenAI Codex <noreply@openai.com>
Bring in the latest v1.0-dev merged into the fix/orphaned-tx base. No conflicts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lklimek lklimek added the blocked Blocked by something external to this issue label Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blocked Blocked by something external to this issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants