Skip to content

fix(rs-platform-wallet): fail-closed on registration persist error (Found-017) [backport]#3659

Draft
lklimek wants to merge 1 commit into
v3.1-devfrom
fix/found-017-v3.1-dev
Draft

fix(rs-platform-wallet): fail-closed on registration persist error (Found-017) [backport]#3659
lklimek wants to merge 1 commit into
v3.1-devfrom
fix/found-017-v3.1-dev

Conversation

@lklimek
Copy link
Copy Markdown
Contributor

@lklimek lklimek commented May 18, 2026

Semantic backport to v3.1-dev of the #3549-proven Found-017 fail-closed fix.

Root cause: register_wallet logged the registration persister.store(...) Err and fell through, then committed in-memory state and returned Ok. The wallet worked for the session but was silently lost on restart — write-acknowledged-but-not-durable.

Fix: on the registration store() Err, keep the tracing::error!, re-acquire the wallet-manager write guard, remove_wallet(&wallet_id) to roll back the in-memory insert_wallet, and return Err(WalletCreation(...)). Fail-closed, mirroring the same function's existing load_persisted / initialize_from_persisted rollback idiom. Reuses the existing WalletCreation variant — no new variant, no error-type churn.

The v3.1-dev region diverged ~62 lines from origin/feat so a textual cherry-pick would not apply; re-applied by hand as a semantic transform. Single remove_wallet fully unwinds — only insert_wallet is committed at the store() point (self.wallets.insert is downstream).

Validation: correctness already proven on #3549 (deterministic network-free pin + positive guard, QA-PASS). v3.1-dev has no found_017 e2e pin by design; here: cargo check --tests clean, clippy --lib -D warnings clean, cargo test --lib 121 passed / 0 failed, rustfmt clean. Pin coverage stays #3549-only.

Sibling PR to #3549.

🤖 Generated with Claude Code

…ound-017) [backport]

Semantic backport of the #3549-proven Found-017 fail-closed fix.
Region diverged on v3.1-dev so the change was re-applied by hand.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 18, 2026

Important

Review skipped

Draft detected.

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: 8094088e-7891-4675-a0d5-464f629bc559

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/found-017-v3.1-dev

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.

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